Home Forums Themes Support Solution for VC tag in search result

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #658

    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 milo_footer.

    You can do it by following steps:

    Step 1: Go to path {yourwebroot}/wp-content/themes/milo-xxx/templates/archive/ then open file content.php, content-audio.php,… (xxx is the name of theme)

    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() != 'milo_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,

    MiloTheme

    • This topic was modified 7 years, 3 months ago by admin.
    • This topic was modified 7 years, 3 months ago by admin.
    • This topic was modified 7 years, 3 months ago by admin.
    • This topic was modified 7 years, 3 months ago by admin.
    • This topic was modified 7 years, 3 months ago by admin.
    • This topic was modified 6 years, 4 months ago by admin.
    • This topic was modified 6 years, 4 months ago by admin.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.