Tagged: archive, grid layout, search
-
AuthorPosts
-
November 30, 2017 at 2:41 am #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).
December 1, 2017 at 9:00 pm #884002Hey LiveBarnKristina,
Please refer to the post here
https://kriesi.at/support/topic/grid-style-search-results-with-sidebar/Thank you very much
Best regards,
BasilisFebruary 23, 2018 at 4:45 am #916501Hello 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,
NickFebruary 24, 2018 at 1:01 pm #917061Hi 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,
VictoriaFebruary 24, 2018 at 6:47 pm #917200Hi 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,
NickFebruary 26, 2018 at 9:56 am #917717Hi,
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,
IsmaelMarch 5, 2018 at 5:15 am #921291Hi 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,
NickMarch 6, 2018 at 3:44 am #921986Hi,
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,
IsmaelMarch 6, 2018 at 5:34 am #922036Hi 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,
NickMarch 7, 2018 at 5:37 am #922734Hi,
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,
IsmaelMarch 8, 2018 at 1:52 am #923495Hi 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,
NickMarch 9, 2018 at 10:27 am #924376Hi,
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,
IsmaelMarch 9, 2018 at 1:51 pm #924476Hi Ismael,
Thank You for your precious support.
March 9, 2018 at 4:02 pm #924582This reply has been marked as private.March 12, 2018 at 9:22 pm #925718Hi,
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,
BasilisMarch 13, 2018 at 12:43 pm #926052Hi Basilis,
Thank you for your feedback and your support.
If Ismael could help, I would really appreciate that!
Thank you in advance.
Best Regards,
NickMarch 15, 2018 at 1:47 pm #927314Hi,
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,
IsmaelMarch 16, 2018 at 5:07 am #927889Hi 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,
NickMarch 17, 2018 at 6:16 am #928357Hi Nick,
Thanks for the feedback. Please open a new thread if you should have any further questions or problems.
Best regards,
RikardApril 16, 2018 at 11:00 am #942498Hi,
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
TobiaApril 18, 2018 at 2:29 am #943331 -
AuthorPosts
- The topic ‘Search Results Page – Grid Layout’ is closed to new replies.