• http://codex.wordpress.org/Post_Types

    $args = array( 'post_type' => 'product', 'posts_per_page' => 10 );
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post();
    	the_title();
    	echo '<div class="entry-content">';
    	the_content();
    ?>
    <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    
    <?php
    	echo '</div>';
    endwhile;
    ?>

    the permalink formed like http://domain.com/product/title

    when i clicked on the permalink it turned page not found

    what parameter should i pass to WP_Query in single-{post_type}.php?

    thanks

  • The topic ‘how query for single-{post_type}.php for custom post_type’ is closed to new replies.