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

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 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.

    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.
    #5440
    Alexsandros
    Support Expired

    This topic helped a lot, Thanks so much.
    Regards

    • This reply was modified 3 years, 7 months ago by Alexsandros.
    #5443

    Thanks for your feedback!

    #4564
    gutmedica
    Support Expired

    Hi,

    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.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.