How do I list products in a category in a custom Marketpress theme?

I'm writing a custom mp_category.php template and want to make it output only the products in the category.

I know I can do this with mp_list_products with the category argument, but that outputs in a standard form and won't work with the custom design I'm building.

I'm trying to replicate that functionality with query_posts but the 'category_name' argument isn't working. Here's what I have:

query_posts(array('post_type' => 'product', 'category_name' => 'foo', 'paged' => false, 'posts_per_page'=>12));

I have multiple products in the 'foo' category but this query loads none of them.

Any ideas?

thanks!

  • George
    • WPMU DEV Initiate

    I figured it out! The proper argument is 'product_category', as in:

    `query_posts(array('post_type' => 'product', 'product_category' => 'foo'));

    I figured it out by looking how mp_list_products does it in the template-functions.php file.

    Sometimes all it takes is asking the question. :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.