How to remove shortcodes from “the content”?
-
Hello!
I like to show “the_content” on archive pages without images and without the shortcode brackets for galleries. I can hide the images by adding a CSS class with and set “display: none;” for img tags.
But I can’t get rid of the shortcodes still showing as link in brackets within the teaser displayed by “the_content”.
I found this function:
function remove_shortcode_from_index($content) { if ( is_home() ) { $content = strip_shortcodes( $content ); } return $content; } add_filter('the_content', 'remove_shortcode_from_index');How do I have to change it to remove shortcodes from all expressions of “the_content” showing (not only on the homepage!)
thx,
piedro
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘How to remove shortcodes from “the content”?’ is closed to new replies.