Hi, is there a way to remove Visual Composer code from page excerpts? E.g.: Search on Page for Home
In my case, I think this code comes from the Newspaper home slider implemented via Visual Composer on top of the home-site. Condition: I don’t want to add text on top of the slider.
Hello loano1,
Unfortunately, I do not exactly understand what you mean, sorry! Do you are referring to this section (Excerpts) -> http://screencast.com/t/Z6qxtazY4i Notice that this feature is created by the theme and not from Visual Composer. All the excerpts can be handle from Theme panel->Excerpts section. For more information about this, please consult the documentation here -> https://forum.tagdiv.com/excerpts-introduction/
If is not what you mean, please provide more details, so I will be able to provide a more accurate response.
Thanks for the message!
Hello,
I’m not sure what the excerpt is grabbing there. It is probably the top ad code. This unusual though as the excerpts should not grab any shortcodes: http://screencast.com/t/dbljJquk
Try to figure out which element in tour theme causes the excerpt to pick up the long string. A simple workaround would be to disable the excerpts on the search by changing the module 16 excerpt length to 0: http://screencast.com/t/0Rz74w8dPWmE
Thank you!
Hi Bogdan,
I just figured out that this code comes from the raw JavaScript fields we added via VC to the end of the page. They are used to show up out-of-home and interstitial ads. If there is no way to keep this code away from the excerpt, it’s not that bad. I just asked because it could have been that there is a simple solution beside removing the excerpt…
Thanks, Loano
Hello,
It seems the raw js element is grabbed by the excerpt and it should not be. Please use your js code in a standard text block like so: http://screencast.com/t/6PNVO1XQBM
The text block code will not show up in the excerpt.
Thank you!
Hello, I tried it on our dev page but the result would be even worse:
https://www.dropbox.com/s/hhd5o7szs3i5scb/Home%20Excerpt%202.JPG?dl=0
Hi,
As a temporary solution to this, you could remove the excerpt from pages on the search module by altering the function in the theme files.
Simply replace this code: http://screencast.com/t/hmBgDljAuPu5
with this one:
<?php if ($this->post->post_type != 'page') {
echo $this->get_excerpt();
}?>
Now your posts will have exceprts but pages will ignore them.
Thank you!