Solved

How do I make a custom product loop in woocommerce just for category display?

Posted on 2015-01-29
1
257 Views
Last Modified: 2015-05-21
Hi,

I'm using WordPress and the Woocommerce plugin and I need to display the category loops differently from the main shop loop but can't work out how to do it.

The theme that I am using uses shortcodes to pull in the product loops. For example:

[product_category category="Courses" orderby="name" order="asc"]

Open in new window


I need to customise this and other category loops differently from the main shop which displays all products.

The main shop will remain as a 4 column grid but the category pages need to have a totally different layout and styling.

I've been all over the web and grepped for code and tags in the plugin dir but I just can't find any hint of what I need to do.

Can someone please point me in the right direction?

Thanks.
0
Comment
Question by:Letterpart
1 Comment
 
LVL 15

Accepted Solution

by:
eemit earned 500 total points
ID: 40580113
You can do the following:

Add columns attribute to the shortcode e.g:
[product_category category="Courses" orderby="name" order="asc" columns="3"]

Open in new window


Style it with CSS (add this to your child theme's style.css) e.g.:
.woocommerce.columns-3 ul.products li.product {
    float: left;
    margin: 0 3.8% 2.992em 0;
    padding: 0;
    position: relative;
    width: 29.4%;
}

Open in new window


You can also try to override content-product_cat.php template
by copying it to yourchildtheme/woocommerce/content-product_cat.php.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read about how to choose the best possible content marketing agency to suit your needs. Content marketing has become an integral part of running a successful tech business, so it is wise to be informed.
This article discusses four methods for overlaying images in a container on a web page
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The viewer will learn how to count occurrences of each item in an array.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now