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
/* ========== START REMOVE ALL ENQUEUED EXISTING SCRIPTS AND STYLEs ========== */ | |
if( !function_exists('clean_wp_head') ): | |
function clean_wp_head(){ | |
if( !function_exists('MY_CUSTOM_POST_TYPE_remove_all_scripts') ): | |
function MY_CUSTOM_POST_TYPE_remove_all_scripts() { | |
global $wp_scripts; $wp_scripts->queue = array(); | |
}//end MY_CUSTOM_POST_TYPE_remove_all_scripts function | |
endif; | |
if( !function_exists('MY_CUSTOM_POST_TYPE_remove_all_styles') AND !is_admin() ): | |
function MY_CUSTOM_POST_TYPE_remove_all_styles() { |
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 echo '<a target="_blank" href="http://maps.google.com/maps?q=' . urlencode( 'ADDRESS GOES HERE' ) . '">View Map</a>'; ?> |
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
RewriteCond %{HTTP_HOST} !^www. | |
RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L] |
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
function is_subpage($pid) { // $pid = The ID of the page we're looking for pages underneath | |
global $post; // load details about this page | |
if(is_page()&&($post->post_parent==$pid||is_page($pid))) | |
return true; // we're at the page or at a sub page | |
else | |
return false; // we're elsewhere | |
} |
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 $currentTax = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?> |
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
/* ===== START RESTRICT USER POSTS ====== */ | |
function restricted_posts_for_current_author($query) { | |
global $user_ID; | |
if($query->is_admin && $user_ID !== 10 ) | |
$query->set('author', -10); | |
unset($user_level); | |
return $query; | |
} | |
add_filter('pre_get_posts', 'restricted_posts_for_current_author'); |
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
function virtual_robots_disallow( $output, $public ) { | |
$output .= "\n" . 'Disallow: /backup' . "\n"; | |
return $output; | |
} | |
add_filter( 'robots_txt', 'virtual_robots_disallow', 10, 2 ); |