Supreme Theme Blog Search results page

This topic contains 5 replies, has 3 voices, and was last updated by  Giri 8 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #228560

    Roman
    Buyer
    Post count: 232

    Hi,

    recently I’ve decided to use blog post search widget and the results came out in a mess, it also included post from the GD Listings, which i suppose shouldn’t be there?
    I don’t know if the demo works the same way, since I didn’t find post search widget there.

    You can check the way it looks here https://www.healthlifemap.com/?s=video
    It would be great if you could fix at least the way it looks in future releases.

    Thanks.

    #228593

    Paolo
    Site Admin
    Post count: 31211

    Hi,

    we can only work on a better template for it, however the default wp search widget works like that and searches for everything, not only blog posts.

    Thanks

    #229145

    Giri
    Expired Member
    Post count: 3155
    This reply has been marked as private.
    #229174

    Roman
    Buyer
    Post count: 232

    Hi, Giri

    it’s because nothing matches your search keyword, try https://www.healthlifemap.com/?s=organic
    Here you’ll see all posts from gd listings.

    It would be cool if you could separate blog search results from gd listings, although probably most important is for them too look better and not with messed up titles in top “featured” area like on the search result from the above-mentioned link.

    Thanks.

    #229319

    Giri
    Expired Member
    Post count: 3155

    Roman, try this code on your child theme’s functions.php file

    Heads Up: This code is not properly tested. So make sure its not breaking GD search results by testing it properly.

    
    
    // search filter
    function roman_custom_search_filter($query) {
        if ( !$query->is_admin && $query->is_search) {
            $query->set('post_type', array('post') );
        }
        return $query;
    }
    add_filter( 'pre_get_posts', 'roman_custom_search_filter' );
    #229322

    Giri
    Expired Member
    Post count: 3155

    If you want to include pages too in search results, add ‘page’ in array

    Thanks

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount