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
/** | |
* Exclude a page and children pages from wp search by making an array | |
* of page id's starting wtih 2927 == id (can't use page slugs) | |
*/ | |
add_filter( 'pre_get_posts', 'filter_the_search' ); | |
function filter_the_search( $query ) { | |
if ( $query->is_search ) { | |
$pages = array( 2927 ); // parent page 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 | |
function remove_comment_feeds( $for_comments ){ | |
if( $for_comments ){ | |
remove_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 ); | |
remove_action( 'do_feed_atom', 'do_feed_atom', 10, 1 ); | |
} | |
} | |
add_action( 'do_feed_rss2', 'remove_comment_feeds', 9, 1 ); | |
add_action( 'do_feed_atom', 'remove_comment_feeds', 9, 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
http://audiorpc.weblogs.com/RPC2 | |
http://www.allpodcasts.com/Ping.aspx | |
http://www.podnova.com/xmlrpc.srf | |
http://ping.podcast.com/ping.php |
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 a default Gravatar if user doesn't have one | |
if ( !function_exists('rYno_newgravatar') ) { | |
function rYno_newgravatar( $avatar_defaults ) { | |
$newgravatar = get_bloginfo('template_url').'/images/new-gravatar.gif'; | |
$avatar_defaults[$newgravatar] = 'New Custom Gravatar'; | |
return $avatar_defaults; | |
} | |
add_filter( 'avatar_defaults', 'rYno_newgravatar' ); |
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
/** Debugging WP */ | |
define('WP_DEBUG', true); //enable the reporting of notices during development - E_ALL | |
define('WP_DEBUG_DISPLAY', true); //use the globally configured setting for display_errors and not force errors to be displayed | |
define('WP_DEBUG_LOG', true); //error logging to wp-content/debug.log | |
define('SCRIPT_DEBUG', true); //loads the development (non-minified) versions of all scripts and CSS and disables compression and concatenation, | |
define('E_DEPRECATED', false); //E_ALL & ~E_DEPRECATED & ~E_STRICT | |
define('AUTOSAVE_INTERVAL', '300'); // Autosave interval | |
define('SAVEQUERIES', true); // Analyse queries | |
define('WP_POST_REVISIONS', false); |
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
/** | |
* Add a CPT into main post/blog archive | |
*/ | |
add_filter( 'pre_get_posts', 'chuckreynolds_add_cpts_to_post_archive' ); | |
function chuckreynolds_add_cpts_to_post_archive( $query ) { | |
if ( is_home() && $query->is_main_query() && empty( $query->query_vars['suppress_filters'] ) ) { | |
$query->set( 'post_type', array( | |
'post', // assuming you still want normal posts in there |
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 | |
/** | |
* Change the name of the main Posts menu and submenus | |
* and change the dashicon of the main menu item | |
*/ | |
function chuck_change_post_type_menu() { | |
global $menu; | |
global $submenu; |
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 | |
/** | |
* RCP metabox is higher than cpt metafields so | |
* let's lower that priority a bit | |
*/ | |
function chuck_rcp_chill_priority() { | |
return 'low'; | |
} | |
add_filter( 'rcp_metabox_priority', 'chuck_rcp_chill_priority' ); |
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
global $user_login; | |
get_currentuserinfo(); | |
if (!current_user_can('update_plugins')) { /* checks to see if current user can update plugins */ | |
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); | |
add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) ); | |
} |