This topic has 15 replies, 2 voices, and was last updated 6 years by Laura.

  • Author
  • #189952
     getmebrian
    Participant

    Hello.

    In the search results, I would like it not to show items in the media library. Under Theme Options > Header, I have excluded media from that search box and it works fine. But how do you do that for other KLEO search forms?

    Thanks!

    Brian

    #190001
     Laura
    Moderator

    Hello, try by adding this to functions.php of child theme 🙂

    COPY CODE
    
    function attachments_search_pre_get_posts( $query ) {
     if (! is_search() )
        return $query;
      $post_types = array( 'post', 'page' );
      $query->set( 'post_type', $post_types );
      return $query;
    }
    add_filter( 'pre_get_posts', 'attachments_search_pre_get_posts' );
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #190002
     getmebrian
    Participant

    Thanks, it is saying there is an issue with this line:

    $query->set( ‘post_type’, $post_types );

    Brian

    #190053
     Laura
    Moderator

    Hello, i see…
    Maybe this can be done with css, do you want to hide ANY image that is shown t search results?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #190056
     getmebrian
    Participant

    Correct. I don’t want it to show results from the media library. Thanks.

    Brian

    #190129
     Laura
    Moderator

    Hello, please try by adding this to style.css of child theme

    COPY CODE
    
    .search-results .wrap-content img {
        display: none !important;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #190137
     getmebrian
    Participant

    Thanks, but that is not working. Media results still show.

    Brian

    #190226
     Laura
    Moderator

    Hello, can you share login access to admin dashboard so i can test it? 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #190239
     getmebrian
    Participant
    This reply has been set as private.
    #190319
     Laura
    Moderator

    Hello, i tested the search and i dont see any image, can you share a screenshot of what do you see?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #190333
     getmebrian
    Participant

    Sure, I see it using the KLEO search in every location I have it enabled. Attached is an image from the home page demo.

    Thx.

    Attachments:
    You must be logged in to view attached files.
    #190509
     Laura
    Moderator

    Hello, i see, try adding this to style.css of child theme

    COPY CODE
    
    .ajax_search_image {
        display: none !important;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #190512
     getmebrian
    Participant

    Hi. That hides the thumbnail images on the Ajax results, which is not what we want to happen. The thumbnail images should show, but the Media results should not show. With this latest code, this is what it looks like attached.

    Brian

    Attachments:
    You must be logged in to view attached files.
    #190729
     Laura
    Moderator

    Hello, please try by adding this to style.css of child theme

    COPY CODE
    
    .kleo-ajax-part.kleo-ajax-type-attachment {
        display: none !important;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #190730
     getmebrian
    Participant

    That did it. Thanks!

    #190872
     Laura
    Moderator

    Glad it worked! If you didn’t already please rate us 5 stars at themeforest, that would help a lot!

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

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

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?