-
AuthorPosts
-
November 3, 2015 at 1:11 pm #651129
Hello,
I am using icon theme with woocommerce. The search results page looks really bad. I just want the search results pages to look like all the other pages displayed under the different product categories, thumbnails in 3 columns with the price. Currently the search results page displays the products as huge photos with the date it was published as if it was a blog post and it also displays the product info.
How can I change this?
Thanks!
November 3, 2015 at 1:29 pm #651160Hello Tim,
Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
Thanks.
November 3, 2015 at 6:31 pm #651486you won’t be able to see the site without logging in to wordpress as it is in “coming soon” mode. please let me know how to provide you details to enter wordpress.
Thanks
TimNovember 3, 2015 at 7:16 pm #651508Hi There,
You could send us your detials in private reply to insure that our staff and you could see the reply.
Thanks.
November 20, 2015 at 7:33 am #672801Hello,
Sorry for the delay.
You can see the site here: http://sparringstore.com.ar/
It is live now so no need to login yet.
November 20, 2015 at 10:26 am #672972Hi there,
Thanks for updating the thread!
By default search results page display content in single column and expand featured images 100% of the container’s width. However, you can add following CSS code under Custom > CSS in the Customizer to show images in their actual size:
.search-results .entry-wrap { text-align: center; } .search-results .entry-wrap .entry-content { text-align: left; } .search-results .entry-featured { display: inline-block; } .search-results .entry-thumb img { min-width: 0; }
Thank you!
November 20, 2015 at 1:29 pm #673280hello, I have put this css into the customizer and nothing happens. Th search results are still in one column like big blog posts.
November 20, 2015 at 6:39 pm #673685Hi again,
Can you please provide us the link of your search result page so we can take a look?
Thanks!
November 20, 2015 at 7:53 pm #673736here is a search page result: http://sparringstore.com.ar/?s=guantes
November 20, 2015 at 11:09 pm #673846Hi there,
Blog search is only applicable for page, posts, portfolio and any post type that isn’t using any special templates. And Woocommerce uses their own standard templates that are not applicable for standard search result. Even if you succeed, you’ll still see mixed layout from both post templates and woocommerce templates.
Some uses special woocommerce extension or custom code to implement search since they don’t wan’t to mess with wordpress’s standard search. In short, it’s not possible to display a product list (that uses
<ul></ul>
for columns and grid) along with normal posts (that uses<div></div>
).Thus, you can only do is set search result for blog only, or set search result for product only. And you can’t mix both.
Follow this,
1. Add this code at your child theme’s functions.php
function searchfilter($query) { if ($query->is_search && !is_admin() ) { $query->set('post_type',array('product')); } return $query; } add_filter('pre_get_posts','searchfilter'); function woocommerce_search_class( $classes ) { if ( is_search() ) { $classes[] = 'woocommerce'; } return $classes; } add_filter( 'body_class', 'woocommerce_search_class' );
2. Copy this file /wp-content/themes/x/woocommerce.php to your child theme and rename it into search.php
Like, /wp-content/themes/x-child/search.php
3. Upload it.
That will work, but lacking with design since woocommerce has no dedicated template for search results.
Thanks.
November 21, 2015 at 10:30 am #674286Hello,
I don’t want to mix blog searches with product searches, I want to set search for products so they display in the layout like the rest of my pages.
I mentioned blog posts because the search results were displaying products as if they were blog posts.
I just want the search results pages to look like all the other pages displayed under the different product categories, thumbnails in 3 columns with the price.
I am not sure how this isn’t possible as I have been on many different woocommerce websites where the search results display
Thank you!
November 21, 2015 at 7:55 pm #674550Hi there,
Those other site uses custom searches dedicated for woocommerce. WordPress alone has only one search feature, and it’s only applicable for blog. WordPress does not come with advance or special search for different post types since there is no way to predict what will be the template and output of the search. Hence it’s user responsibility to add their own advance search. The primary goal for X theme is to follow wordpress standard. Though, I’ll add this as feature request.
You can follow the above procedure, but that will replace your default blog search in place for product search. You’ll need another dedicated search functionality if you wish to have a separate product search, and through custom development.
Thanks for understanding.
-
AuthorPosts