Home › Forums › Themes Support › How to remove VC tag (WP Bakery Page Builder tag) in Search Result
Tagged: search
- This topic has 3 replies, 3 voices, and was last updated 2 years ago by
gutmedica.
-
AuthorPosts
-
November 29, 2018 at 2:40 am #2423
Hi All Customer.
When you search the result in some case can display Visual Composer shortcode tags. The solution in this case we will don’t display the_excerpt if post type is page or custom post type as haru_footer.
In this example we’ll do it direct in parent theme. However you should do it via child theme to keep your custom work when update theme follow this topic tutorial: https://harutheme.com/forums/topic/customize-wordpress-theme-using-child-theme/
You can do it by following steps:
Step 1: Go to path {yourwebroot}/wp-content/themes/xxx/templates/archive/ then open file content.php, content-audio.php,… (xxx is the name of theme)
Note: You can go to Appearance -> Editor and select XXX is theme in the right corner.Step 2:
Find the code like this:
if ( has_excerpt() ) { echo wp_trim_words( get_the_excerpt(), $post_excerpt, '...' ); } else { echo wp_trim_words( get_the_content(), $post_excerpt, '...' ); }
then change to:
if ( get_post_type() != 'page' && get_post_type() != 'haru_footer' ) { // Or other post type if ( has_excerpt() ) { echo wp_trim_words( get_the_excerpt(), $post_excerpt, '...' ); } else { echo wp_trim_words( get_the_content(), $post_excerpt, '...' ); } }
Please make sure you copy correct code like this:
https://prnt.sc/rvamat
and the result:
https://prnt.sc/rvamss
If you can’t save that’s mean you wrong syntax of PHP.Update new solution:
You also can use this code:if ( has_excerpt() ) { echo wp_trim_words( strip_tags( do_shortcode( get_the_excerpt() ) ), $post_excerpt, '...' ); } else { echo wp_trim_words( strip_tags( do_shortcode( get_the_content() ) ), $post_excerpt, '...' ); }
Hope this help you all and thanks for reading!
*********
Best regards,
HaruTheme
-
This topic was modified 5 years ago by
admin.
-
This topic was modified 5 years ago by
admin.
-
This topic was modified 5 years ago by
admin.
-
This topic was modified 5 years ago by
admin.
-
This topic was modified 3 years, 8 months ago by
admin.
-
This topic was modified 3 years, 8 months ago by
admin.
-
This topic was modified 3 years, 7 months ago by
admin.
-
This topic was modified 3 years, 7 months ago by
admin.
-
This topic was modified 2 years, 9 months ago by
admin.
April 9, 2020 at 8:02 am #5440This topic helped a lot, Thanks so much.
Regards-
This reply was modified 3 years, 7 months ago by
Alexsandros.
April 9, 2020 at 8:09 am #5443Thanks for your feedback!
November 13, 2021 at 8:51 am #4564Hi,
I would like to make a change in the picture doctor page.
Example
Here de picture is:
https://gutmedica.com/especialistas/
But I need use other picture to
https://gutmedica.com/doctor/dr_david-paramo/
The picture between the board page have to be different
understand?
Attachments:
You must be logged in to view attached files. -
This topic was modified 5 years ago by
-
AuthorPosts
You must be logged in to reply to this topic.