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__ ) ] ); |
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 theme from updating | |
* http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/ | |
*/ | |
function s25_no_update_theme( $r, $url ) { | |
if ( 0 !== strpos( $url, 'http://api.wordpress.org/themes/update-check' ) ) | |
return $r; // Not a theme update request. Bail immediately. | |
$themes = unserialize( $r['body']['themes'] ); | |
unset( $themes[ get_option( 'template' ) ] ); |
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 | |
// Hide Editor on Select Pages | |
function s25_hide_editor() { | |
// Get the Post ID. | |
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ; | |
if( !isset( $post_id ) ) return; | |
// Hide the editor on the page titled 'Homepage' | |
$homepgname = get_the_title($post_id); |
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 | |
// Filter Yoast Meta Priority | |
function move_yoast_seo_box() { | |
if ( defined( 'WPSEO_VERSION' ) ) : | |
add_filter( 'wpseo_metabox_prio', function() { return 'low'; } ); | |
endif; | |
} | |
add_action('admin_init', 'move_yoast_seo_box'); | |
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 | |
/** | |
* Use the page slug to filter the 'show-on' of a meta box | |
* @author Pat Ramsey | |
* @link https://gist.github.com/ramseyp/6227383 | |
* | |
* @param bool $display | |
* @param array $meta_box | |
* @return bool display metabox | |
*/ |
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 | |
/** | |
* Displays the content of a custom field, along with wrapping code or content. | |
* @param string $key name, or key, of the custom field. | |
* @param string $before what should be shown directly before the custom field value. | |
* @param string $after what is output directly after the custom field value. | |
* @param boolean $wpautop filters the value through wpautop(). | |
* @return string first value of the custom field, prepended by $before, followed by $after. | |
*/ |
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 | |
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 ); |