I have created custom post type ‘portfolio’ in my web-site. I am able to create categories,posts… etc. I have created category page which displays all the post according to the category and I have done it by using following chunk of code in archive.php
<?php $cat = get_query_var('cat');?>
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
<?php query_posts('showposts=3&post_type=portfolio&category_name=web-design&order=ASC&paged='.$paged); ?>
<div id="page" class="category_post grid_12">
<?php while (have_posts() ) : the_post(); ?>
<div class="grid_3 single-post">
<div class="list-post">
<a class="read-more" href="<?php echo get_permalink()?>"><?php echo the_post_thumbnail(array(213,185));?></a>
</div>
<p>
<?php $content=trim(get_field("description"));
echo $half_content=substr($content,0,88)."..." ?>
<a class="category-link" href="<?php echo get_permalink()?>">Read more</a>
</p>
</div>
<?php endwhile; ?>
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
Also I am using wp_pagenavi plugin for pagination. Now my problem is that when I click on page 2 i.e next page, it does not display the newer posts on it. Kindly tell me what’s wrong with the above code.
Do your custom post type has has_archive property setted to true? Do you use archive template or tring to query posts in a template code?