Me again,
I wonder how I should remove the [shortcode] from my excerpt!
I never use the excerpt field into the post... and let wordpress create them for me.
So when I have a [shortcode] at the top of the post, this one is displayed into the excerpt.
I found the solution here but I don't want to hardcode it into Platform Pro and would prefer to modify my child theme...
Any advices?
Exclude [shortcode] from the excerpt!
Started by
thelbc
, Oct 20 2010 03:54 PM
2 replies to this topic
#1
Posted 20 October 2010 - 03:54 PM
#2
Posted 20 October 2010 - 04:10 PM
I tried this but it doesn't work!
Any help would be appreciated.
function remove_shortcode_from_index($content) {
if ( is_home() ) {
$content = strip_shortcodes( $content );
}
return $content;
}
add_filter('the_excerpt', 'remove_shortcode_from_index');
Any help would be appreciated.
#3
Posted 20 October 2010 - 05:27 PM
My thoughts are that the filter should work. Double check the function 'strip_shortcodes'... or try some other functions there. (this will only work on your homepage/posts page fyi)










