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

I am using query post in loop.php

query_posts( array('post_type'=>array('product','post'),'paged'=>$paged ) );

So that the custom post 'product' (woocommerce product) can be displayed on home page.

I am able to see 'product' & 'post' in home page of theme1 but not in theme2, what might be the problem?, suggest me place where I should check; What should I check?

share|improve this question

Here's a product loop I found:

    <ul class="products">
    $args = array(
        'post_type' => 'product',
        'posts_per_page' => 12
    $loop = new WP_Query( $args );
    if ( $loop->have_posts() ) {
        while ( $loop->have_posts() ) : $loop->the_post();
            woocommerce_get_template_part( 'content', 'product' );
    } else {
        echo __( 'No products found' );

Maybe that will help.

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.