WordPress.org

Ready to get started?Download WordPress

Forums

Tag archive pagination don't work (2 posts)

  1. Anydog
    Member
    Posted 3 years ago #

    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 ... ?

  2. Anydog
    Member
    Posted 3 years ago #

    Well, I tried all kinds of solutions and none of them worked ...
    So, I'm step away to remove pagination from tag archive page (i.e. I admit defeat ).
    This is my last call ... please does anyone know solution to this ?

Topic Closed

This topic has been closed to new replies.

About this Topic