-
Author
-
February 27, 2018 at 04:59 #189952
getmebrian
ParticipantHello.
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
February 27, 2018 at 18:41 #190001Laura
ModeratorHello, try by adding this to functions.php of child theme 🙂
COPY CODEfunction 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 solutionFebruary 27, 2018 at 18:46 #190002getmebrian
ParticipantThanks, it is saying there is an issue with this line:
$query->set( ‘post_type’, $post_types );
Brian
February 28, 2018 at 04:34 #190053Laura
ModeratorHello, 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 solutionFebruary 28, 2018 at 05:09 #190056getmebrian
ParticipantCorrect. I don’t want it to show results from the media library. Thanks.
Brian
February 28, 2018 at 18:51 #190129Laura
ModeratorHello, 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 solutionFebruary 28, 2018 at 20:20 #190137getmebrian
ParticipantThanks, but that is not working. Media results still show.
Brian
March 1, 2018 at 20:34 #190226Laura
ModeratorHello, 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 solutionMarch 1, 2018 at 21:42 #190239getmebrian
ParticipantSure. Here you go:
u: AthletesLikeMe
pw: V1gv2O&FvAC!Brian
March 3, 2018 at 03:39 #190319Laura
ModeratorHello, 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 solutionMarch 3, 2018 at 05:09 #190333getmebrian
ParticipantSure, I see it using the KLEO search in every location I have it enabled. Attached is an image from the home page demo.
Thx.
March 5, 2018 at 03:58 #190509Laura
ModeratorHello, 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 solutionMarch 5, 2018 at 04:20 #190512getmebrian
ParticipantHi. 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
March 6, 2018 at 22:13 #190729Laura
ModeratorHello, 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 solutionMarch 8, 2018 at 05:22 #190872Laura
ModeratorGlad 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 -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.