0
votes

Recently I'm working in a wp project. I create a custom post type name myproducts & I use wp-pagenavi plugin for create custom post navigation. But Its not work properly. Here is my code:

<?php /*** Template Name: Products ***/ ?>
<?php get_header(); ?>

<ul>
<?php query_posts( 'posts_per_page=10&post_type=playstore' ); ?>
<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>

<div>
<li>
Products here
</li>
</div>

<?php endwhile; ?>
</ul>
<div class="page_nav">
<?php wp_pagenavi(); ?>
</div>
<?php else : ?>
<p>Nothing Found!</p>
<?php endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

I also tried in search google, stackoverflow. I also tried those tutorial:

But my bad luck, no one are worked :( Please help me.

Thanks

1

1 Answers

0
votes

I once had a similiar problem and this was my solution

<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>

<?php query_posts( 'posts_per_page=10&post_type=playstore&paged=' . $paged ); ?>