Home Forums Themes Support How to remove VC tag (WP Bakery Page Builder tag) in Search Result

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #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.phpcontent-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.

    Hope this help you all and thanks for reading!

     

    *********

    Best regards,

    HaruTheme

    • This topic was modified 1 year, 6 months ago by admin.
    • This topic was modified 1 year, 6 months ago by admin.
    • This topic was modified 1 year, 6 months ago by admin.
    • This topic was modified 1 year, 6 months ago by admin.
    • This topic was modified 2 months, 3 weeks ago by admin.
    • This topic was modified 2 months, 3 weeks ago by admin.
    • This topic was modified 1 month, 3 weeks ago by admin.
    • This topic was modified 1 month, 3 weeks ago by admin.
    #5440
    Alexsandros
    Supported

    This topic helped a lot, Thanks so much.
    Regards

    • This reply was modified 1 month, 3 weeks ago by Alexsandros.
    #5443

    Thanks for your feedback!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.