Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #883271

    Is it possible to return search results so that they appear as a grid layout? I was able to do so for my archive pages, but Search results look awful.

    Tag Archive Page: http://news.livebarn.com/tag/new-jersey-colonials/ (this looks great)

    Search Results Page: http://news.livebarn.com/?s=glacier (this looks horrible).

    #884002

    Hey LiveBarnKristina,

    Please refer to the post here
    https://kriesi.at/support/topic/grid-style-search-results-with-sidebar/

    Thank you very much

    Best regards,
    Basilis

    #916501

    Hello Basilis,

    How are you?

    That post you are reffered to: https://kriesi.at/support/topic/grid-style-search-results-with-sidebar/

    it didn’t work at all to me…

    I pasted the above code in search.php and I missed the site.

    Could you help me?

    Thanks in advance.

    Best regards,
    Nick

    #917061

    Hi Nick,

    Search results are always a list, everywhere, in Google and other websites, the users are so used to it this way, so that they can get confused getting to search results in form of a grid. Just something for you to consider.

    Best regards,
    Victoria

    #917200

    Hi Victoria,

    Thank you for your quick reply.

    In a blog to have blog style search results, it’s common, but I have a woocommerce and so blog style search results aren’t so much professional. Most of modern e-shops have grid layout search results and I think a very powerful and popular theme as Enfold should have this feauture as default.
    Basilis has shared a solution, so I replaced search.php with those one, but it indexes only blog posts and not products.

    Could you help me to achieve that?

    Thank You in advance.

    Best Regards,
    Nick

    #917717

    Hi,

    Please edit the search.php file, look for this code around line 51.

    get_template_part( 'includes/loop', 'search' );
    

    Replace it with:

    global $posts;
                            $post_ids = array();
                            foreach($posts as $post) $post_ids[] = $post->ID;
    
                            if(!empty($post_ids))
                            {
                                $atts   = array(
                                    'type' => 'grid',
                                    'items' => get_option('posts_per_page'),
                                    'columns' => 3,
                                    'class' => 'avia-builder-el-no-sibling',
                                    'paginate' => 'yes',
                                    'use_main_query_pagination' => 'yes',
                                    'custom_query' => array( 'post__in'=>$post_ids, 'post_type'=>get_post_types() )
                                );
    
                                $blog = new avia_product_slider($atts);
                                $blog->query_entries();
                                echo "<div class='entry-content-wrapper'>".$blog->html()."</div>";
                            }

    Use this code in the Quick CSS field.

    .template-search .post-entry.slide-entry {
        position: relative;
        clear: none;
    }

    Best regards,
    Ismael

    #921291

    Hi Ismael,

    You are a brilliant developer!!!

    Your code worked!!!

    1. The issue I am facing now, is that I would like to display the price and not the excerpt, comments…etc..

    Previous time, you send me the code below for loop-search.php which is not working now.

    global $product;
    echo $product->get_price_html();

    Actually, I would like to achive that: https://prnt.sc/imx8an

    2. Is that easy to display in search results the same construction of products as in Shop Archive? If you achive that, you will cover my previous issue too. Pls see that screenshot: https://prnt.sc/imx9xp

    3. Why product featured images are not aligned inside thumbnail in search result page as in shop archive? I did Regenerate Shop thumbnails in woocommerce products but no result.

    I would like your precious support.

    Thank You in advance.

    Best regards,
    Nick

    #921986

    Hi,

    Glad it worked. We updated the code above in order to display the theme’s product grid instead of the default blog grid layout. Please try it again.

    Best regards,
    Ismael

    #922036

    Hi Ismael,

    I really appreciate your support! You are great!

    You almost done, you actually achieved the theme’s product grid but the search results have nothing to do with the keyword search.
    I actually mean, whatever I type as keyword search, the results will be always the same.

    I have two examples below with diffrerent keyword but it displays same results.

    http://zoomit.gr/wordpress_2/?s=%CF%81%CE%B1%CE%BA%CE%AD%CF%84

    http://zoomit.gr/wordpress_2/?s=%CF%86%CE%BF%CF%85%CF%83%CE%BA

    I am waiting your news.

    Thank You in advance,

    Best regards,
    Nick

    #922734

    Hi,

    Please try this filter in the functions.php file.

    add_filter('avia_product_slide_query', 'avia_product_slide_query_mod', 10, 2);
    function avia_product_slide_query_mod($query, $params) {
    	if(is_search()) {
    		$query['s'] = $_GET['s'];
    	}
    
    	return $query;
    }

    Best regards,
    Ismael

    #923495

    Hi Ismael,

    You are the best of the best!!! As always, your code worked!!!

    Kriesi must be proud of you!!

    One last issue if you could: div. product-sorting (sorting and display products bar) can be in search page also?

    Thank You so much!!!

    p.s. I think Kriesi should include in future updates product grid as an option

    Best regards,
    Nick

    #924376

    Hi,

    Glad it worked. Thank you for the kind words. :D

    Please feel free to request – or vote if already requested – such feature on Enfold feature request form. It will be added in the list if it garnered enough votes.

    And if you have the time, please review our theme and show your support https://themeforest.net/downloads
    To know more about enfold features please check – http://kriesi.at/documentation/enfold/
    Thank you for using Enfold :)

    Best regards,
    Ismael

    #924476

    Hi Ismael,

    Thank You for your precious support.

    #924582
    This reply has been marked as private.
    #925718

    Hi,

    I am afraid from what I see it does require a lot of work, as would require to modify the query completely – but I might be wrong.
    Ismael is always a rockstar on such cases, so I have assigned him to be able to help further.

    Best regards,
    Basilis

    #926052

    Hi Basilis,

    Thank you for your feedback and your support.

    If Ismael could help, I would really appreciate that!

    Thank you in advance.

    Best Regards,
    Nick

    #927314

    Hi,

    I’m sorry but we can’t help you with the sorting option this time because it will require a lot of modifications. Please hire a freelance developer or contact our partner, Codeable.

    // https://kriesi.at/contact/customization

    Ask them to modify the “avia_woocommerce_frontend_search_params” function inside the config-woocommerce > config.php file.

    Best regards,
    Ismael

    #927889

    Hi Ismael,

    I can really understand that it requires a lot of customizations and it takes a lot of time, so I will contact with your partner for that.

    Thank you for your guidelines. I really appreciate that.

    You can close the ticket.

    Best regards,
    Nick

    #928357

    Hi Nick,

    Thanks for the feedback. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

    #942498

    Hi,
    I tried this code but i see only the products in the search results. I don’t see the simple post though the count of all the results also includes the post.
    Why?
    thanks
    Tobia

    #943331

    Hi,

    @digitos: That’s intended because the “avia_product_slider” shortcode has been used. It will only query product items. Please open a new thread or ticket. We’ll close this one now.

    Best regards,
    Ismael

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

The topic ‘Search Results Page – Grid Layout’ is closed to new replies.