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 | |
/** | |
* | |
* Add page template column to page listing. Make the Template column sortable | |
* http://www.codehooligans.com/2011/07/13/adding-custom-columns-to-wordpress-post-listing/ | |
* http://justintadlock.com/archives/2011/06/27/custom-columns-for-custom-post-types/ | |
* | |
*/ |
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
/** | |
* Name: fluidimage.js | |
* | |
* @author Pat Ramsey <pat@slash25.com> | |
* @copyright Copyright (c) 2011, Pat Ramsey | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
* @description Part of the WP Fluid Images plugin. Replaces pixel-based width & height attributes with style attributes using percentages. | |
* | |
*/ |
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 s25_member_loop() { | |
$args = array( | |
'role' => 'member', // the role we're targeting | |
'exclude' => '1', // exclude admin | |
'fields' => 'all_with_meta', | |
'meta_key' => 'last_name', //query on the last_name key | |
'meta_key' => 'first_name', // also the first_name key | |
); | |
$membersquery = new WP_User_Query( $args ); |
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 | |
/** | |
* Basic slider. Uses flexslider.js, theme options framework, a custom post type and custom meta boxes. | |
* | |
* @author Pat Ramsey | |
* @link http://slash25.com | |
*/ | |
add_image_size( 'slider', 920, 286, true ); // we want a new image size for the slider background |
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 | |
/** | |
* | |
* Wrap get_search_form with wp_is_mobile() to conditionally load the form in the header. | |
* | |
*/ | |
if ( !wp_is_mobile() ) { | |
get_search_form(); | |
} |
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 | |
/** | |
* | |
* Test for mobile browsers - if wp_is_mobile is true, then do something. | |
* | |
*/ | |
if ( wp_is_mobile() ) { | |
echo "Do Something if it's a mobile device"; | |
} |
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
/** | |
* Works with this Gist: https://gist.github.com/3827830 | |
*/ | |
/* Use this to add styles as necessary to override default form label styles */ | |
.infusion-form .infusion-field .label-placeholder { } | |
.infusion-form .infusion-field, | |
.infusion-form .infusion-field .inf_group { | |
position:relative; |
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 | |
/** | |
* | |
* first function gets URL of the current page, which is used in the search as the action parameter. | |
* second function loads a search box above the content of a Genesis category archive. | |
* the category name ( slug ) is passed through a hidden input as a search query parameter. | |
* | |
**/ | |
function current_page_url() { | |
$pageURL = 'http'; |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
/** | |
* Keep your plugin from updating | |
* http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/ | |
*/ | |
function s25_plugin_no_update( $r, $url ) { | |
if ( 0 !== strpos( $url, 'http://api.wordpress.org/plugins/update-check' ) ) | |
return $r; // Not a plugin update request. Bail immediately. | |
$plugins = unserialize( $r['body']['plugins'] ); | |
unset( $plugins->plugins[ plugin_basename( __FILE__ ) ] ); |