Tuesday, February 19, 2013

How to remove shortcode from home but not from the entire blog

Just paste the code to your function.php to remove the shortcode value from index.php or home.php but not from the rest of your template
function wpc_no_shortcode_home($content) {
    if ( is_home() ) {
      $content = strip_shortcodes( $content ); 
   }    
return $content;  
}  
add_filter('the_content', 'wpc_no_shortcode_home');

No comments:

Post a Comment