[wp-hackers] Excerpt output
Dino Termini
dino at duechiacchiere.it
Wed Jun 11 13:07:09 UTC 2014
Hi,
my website uses shortcodes to define the structure of each page (Visual
Composer). Since I don't use excerpts, search results display the
content generated by those shortcodes. Is there a way to tweak
the_excerpt so that all but one shortcode are stripped from the output?
Example:
[vc_row][vc_column width="1/4" el_class="sidebar"]sidebar content
here[/vc_column][vc_column width="3/4"][vc_column_text
el_class="use-as-excerpt"]main content[/vc_column_text][/vc_column][/vc_row]
When the excerpt is displayed, it should return just what's inside the
vc_column_text shortcode: main content.
When inspecting the content passed to the function by add_filter(
'the_excerpt', 'strip_shortcodes' ), 100 ) , I see the shortcodes have
already been executed :/
Thanks,
Dino.
More information about the wp-hackers
mailing list