Hi, I have this code that doesn't work, that is, the pagination don't work. When I click to get page 2 I get 404 Nothing found page. And it always shows like there are only two pages of posts when I know for a fact that there should be 4 pages (18 posts associated with one particular tag..). Here's the code
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$temp = $companies;
$companies = null;
$companies = new WP_query(array(
'post_type' => 'company',
'tag' => $tag,
'posts_per_page' => 5,
'meta_key' => 'member',
'meta_value' => 'Yes',
'orderby' => 'title',
'order' => 'ASC',
'paged' => $paged
));
?>
<ul>
<?php while ($companies->have_posts()) : $companies->the_post(); ?>
<li><?php the_title(); ?></li>
<?php endwhile; ?>
</ul>
<div id="navigation">
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
</div>
Can anyone point me to solution ... ?