Home Forums Themes Support How to remove VC tag in Search Result

Tagged: 

This topic contains 0 replies, has 1 voice, and was last updated by  admin 3 months, 3 weeks ago.

Viewing 1 post (of 1 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.

    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, '...' ); 
    } 
    }

    Hope this help you all!

     

    *********

    Best regards,

    HaruTheme

    • This topic was modified 3 months, 3 weeks ago by  admin.
    • This topic was modified 3 months, 3 weeks ago by  admin.
    • This topic was modified 3 months, 3 weeks ago by  admin.
    • This topic was modified 3 months, 3 weeks ago by  admin.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.