• I have a taxonomy archive template; ‘taxonomy-category-portfolio.php’ however I am trying to get pagination to work on it but when I click the ‘next’ button I get a 404 error.

    Template code below, any ideas what the issue could be?

    <?php get_header(); ?>		
    
    		<?php get_template_part('include', 'filter-portfolio'); ?>
    
    		<?php query_posts($query_string . '&posts_per_page=1&paged=' . $paged); ?>
    			<?php get_template_part('loop', 'portfolio'); ?>
    		<?php wp_reset_query(); ?>
    
    	</div><!--end content-->
    	<?php get_sidebar(); ?>
    <?php get_footer(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Guessing this is a custom post type with a custom taxonomy yes?

    Had problems with this on another site, this is what I used if its any help:

    <?php
    		global $wp_query;
    
    		$big = 999999999; // need an unlikely integer
    
    		echo paginate_links( array(
    			'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
    			'format' => '?paged=%#%',
    			'current' => max( 1, get_query_var('paged') ),
    			'total' => $wp_query->max_num_pages
    		) );
    	?>

    Need this it the loop query too:

    'posts_per_page' => ($paged < 2) ? 11 : 12,
    		'paged' => $paged

    Thread Starter 000000000

    (@pealo86)

    Thanks but I couldn’t get it to work unfortunately! Hmmmmm

    Thread Starter 000000000

    (@pealo86)

    Ahhh managed to sort it with this actually:
    https://websitesthatdontsuck.com/2011/12/taxonomy-archive-pagination-404/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pagination not working on taxonomy archive’ is closed to new replies.