- GitHub Staff
- http://astockwell.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var output = document.getElementById('output'); | |
function assert( outcome, description ) { | |
var li = document.createElement('li'); | |
li.className = outcome ? 'pass' : 'fail'; | |
li.appendChild( document.createTextNode( description ) ); | |
output.appendChild(li); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Now; | |
if (typeof performance !== 'undefined' && performance.now) { | |
Now = function() { | |
return performance.now(); | |
}; | |
} else if (Date.now) { | |
Now = function() { | |
return Date.now(); | |
}; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Place in "body > header" or equivalent --> | |
<?php edit_post_link( __('Edit'), '<span class="edit-link">', '</span>' ); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Now; | |
if (typeof performance !== 'undefined' && performance.now) { | |
Now = function() { | |
return performance.now(); | |
}; | |
} else if (Date.now) { | |
Now = function() { | |
return Date.now(); | |
}; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'faculty', | |
'meta_query' => array( | |
// 'relation' => 'AND', | |
// array( | |
// 'key' => 'online-extra-type', | |
// 'value' => 'Your Space', | |
// 'compare' => '=' | |
// ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function xyz_create_cpt_animal() { | |
$label_singular = 'Animal'; | |
$label_plural = $label_singular . 's'; | |
$labels = array( | |
'name' => __($label_plural), | |
'singular_name' => __($label_singular), | |
'add_new' => __('Add New'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Referencing http://wordpress.stackexchange.com/questions/1753/when-should-you-use-wp-query-vs-query-posts-vs-get-posts ?> | |
<?php | |
// EXAMPLE new WP_Query object | |
?> | |
<?php | |
// Query posts by new criteria. | |
$args = array( | |
'posts_per_page' => -1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> | |
<section> | |
<!-- Put the following javascript before the closing </head> tag. --> | |
<script> | |
(function() { | |
var cx = '000000000000000000000:aaa1aa1aa1a'; | |
var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; | |
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + | |
'//www.google.com/cse/cse.js?cx=' + cx; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// One wp-config.php file for multiple environments setup from http://www.messaliberty.com/2010/01/how-to-create-a-single-wp-config-file-for-local-and-remote-wordpress-development/ | |
if ($_SERVER['REMOTE_ADDR']=='127.0.0.1' || $_SERVER['REMOTE_ADDR']=='localhost' || preg_match('/^192\.168\.5\./', $_SERVER['REMOTE_ADDR'])) { | |
define('WP_ENV', 'local'); | |
} elseif ($_SERVER['HTTP_HOST']=='tld.stagingurl.com') { | |
define('WP_ENV', 'staging'); | |
} else { | |
define('WP_ENV', 'production'); | |
} | |
if ( WP_ENV == 'local' ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($('.lt-ie8').is('*')) { | |
//code | |
} |