Support » Themes and Templates » custom page template querying custom post type pagination not working

  • hc4zrr324


    I have a page template querying a custom post type that I’m trying to set up pagination on. My permalink settings is set to Postname (/%postname%/). But the pagination links don’t show up. I’ve gone through a bunch of the codex and I’m at a loss. Below is an oversimplified version of what I’m going for and it still doesn’t show the pagination links. Thanks for your help!

    * Template Name: Artworks Index
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $the_query = new WP_Query(array(
    	'post_type' => 'artpress_artwork',
    	'paged' => $paged,
    	'posts_per_page' => 5,
    <div class="artworksIndex">
    	<h2 class="artworksIndex-title">Our Artworks</h2>
    	<div class="artworksIndex-artists">
    	<?php while($the_query->have_posts()):
    	endwhile; ?>
    <div class="clear--both"></div>
    <div class="pagination">
    	<span class="pagination-prev"><?php next_posts_link('<< Prev') ?></span>
    	<span class="pagination-next"><?php previous_posts_link('Next >>') ?></span>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘custom page template querying custom post type pagination not working’ is closed to new replies.