WordPress.org

Ready to get started?Download WordPress

Forums

how query for single-{post_type}.php for custom post_type (1 post)

  1. anthar01
    Member
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.