Skip to content

Instantly share code, notes, and snippets.

View wp-query-ref.php
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@helen
helen / repeatable-fields-metabox.php
Created Jan 11, 2012
Repeating Custom Fields in a Metabox
View repeatable-fields-metabox.php
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
@necolas
necolas / snippet.js
Created Jun 14, 2011
Optimised async loading of cross-domain scripts
View snippet.js
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@cballou
cballou / wordpress-multi-env-configphp-setup.php
Created Aug 15, 2011
Wordpress Multi-Environment wp-config.php Setup
View wordpress-multi-env-configphp-setup.php
<?php
/**
* This code is intended to be added to your wp-config.php file just below the top comment block.
* It should replace the existing define('DB_*') statements. You can add or remove sections
* depending on the number of environments you intend to setup. You should change all values of
* DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST for each environment, making them all distinct
* for security purposes.
*/
// determine the current environment
@luetkemj
luetkemj / style.css
Created Mar 9, 2012
WP-CSS: Wordpress classes
View style.css
/* =============================================================================
WordPress WYSIWYG Editor Styles
========================================================================== */
.entry-content img {
margin: 0 0 1.5em 0;
max-width: 100%;
height: auto;
}
.alignleft, img.alignleft {
@chrismeller
chrismeller / five.php
Created Sep 19, 2011
Validating File Uploads in Kohana 3.2
View five.php
echo Form::open( null, array( 'enctype' => 'multipart/form-data' ) );
You can’t perform that action at this time.