Created
March 15, 2016 20:58
-
-
Save ScottDeLuzio/8c843484dd3ab8865718 to your computer and use it in GitHub Desktop.
Strip shortcodes from the content home/blog page
This file contains hidden or 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 | |
/* | |
Plugin Name: Strip Shortcodes | |
Description: Strip shortcodes from home/blog posts page | |
*/ | |
function strip_shortcode_from_excerpt( $content ) { | |
if ( is_home() ) { | |
$content = strip_shortcodes( $content ); | |
} | |
return $content; | |
} | |
add_filter( 'the_content', 'strip_shortcode_from_excerpt' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an adaptation of the code found on https://codex.wordpress.org/Function_Reference/strip_shortcodes
Added here to easily download and install a plugin version of the same code.