Options to nuke shortcodes in search results of template without the_excerpt()
-
Greetings! What options exist for eliminating shortcodes (specially Visual Composer short codes) from Relevanssi search results (problem with pages excerpts not, not post excerpts), when the wordpress vendor’s template does not contain the following hook?
the_excerpt()
This is an old issue I’m revisiting. It seems that Relevanssi is not compatible with the Athena Pro theme (out of the box), because of that theme’s lack of the above common hook. I’m looking for a quick solution, which could include paying relevanssi to take care of this.
This is probably why none of the relevanssi forum’s suggested function.php modifications (which I tried) worked.
From the template vendor: “Not all themes use the_excerpt() to display shortened sections of content. Athena Pro’s search.php gathers the results of the search query and loops through them, and for each result it finds, it outputs the details of that search item according to the following template, located here:
athena_pro/template-parts/content-blog.php
If you look in that template, the content is being output while wrapped in a strip_shortcodes() call, and that should remove any shortcodes from the content, so long as those shortcodes are registered with an active plugin. Any content attached to the post should be having those shortcodes stripped.
If you are indeed looking to add an excerpt, then you would need to modify the content-blog.php to include that call, then style it accordingly. This would mean that the excerpt would appear on every post that uses content-blog.php, which includes the blog roll and other similar pages.”
- The topic ‘Options to nuke shortcodes in search results of template without the_excerpt()’ is closed to new replies.