how to display custom post type in wordpress


<?php  $args = array( ‘post_type’ => ‘product’,’cat’=>’9′,’order’ => ‘ASC’,’posts_per_page’ => 3);
$the_query = new WP_Query( $args );
?>

<?php if ( $the_query->have_posts() ) : ?>

<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

<?php the_post_thumbnail(); ?>

<?php the_title(); ?></h3><?php the_content(); ?>

<?php endwhile; ?>
<?php endif; ?>

Leave a comment