WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ok I'm using the plugin "The Cart Press" and I am trying to understand how multiple loops work when using a custom post type.

If I do a regular query for posts it just gives me back my blog posts and not my TCP products. When displaying products regularly they use the same loop functions as blog posts and so I'm wondering what is happening differently to cause these products to be loaded.

I have used a portfolio plugin in the past called "Simple Portfolio" which has a custom function called simple_portfolio_get_projects() which just gives me an array of projects and I would like to be able to do the same with TCP products.

share|improve this question
The code you are using for the loops, especially the queries, would be useful. – toscho Nov 6 '12 at 11:19
Currently I am just using the regular loop. It uses its own taxonomy www.example.com/product_category/category-slug to list the items and then www.example.com/product/product-slug for the product. But inside the page for a single product I want to be able to show all other products in the same category. – Jacob Tomlinson Nov 6 '12 at 11:27

I've managed to do it by setting the post type when I make the query

$my_query = new WP_Query( array("post_type" => "tcp_product"));
if ( $my_query->have_posts() ) { 
    while ( $my_query->have_posts() ) { 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.