404 page errors with custom post type pagination
-
Hello all, I keep getting 404 page when I click on my older/newer posts link in my custom post type. Any help would be appreciated. Here’s my code:
<section id="event-listings"> <?php $args = array( 'post_type' => 'events', 'posts_per_page' => 2, 'paged' => get_query_var('paged') ); $global_posts_query = new WP_Query($args); ?> <?php if (have_posts()) : while ($global_posts_query->have_posts()) : $global_posts_query->the_post(); ?> <article class="post"> <div class="date"> <p><?php the_field('date'); ?><br><span class="year"><?php the_field('year'); ?></span></p> </div> <h2><?php the_field('headline'); ?></h2> <p class="location"><?php the_field('location'); ?> ♥ <?php the_field('time'); ?></p> <p class="coordinator">Created by: <span class="name"><?php the_field('author'); ?> on <time datetime="<?php echo date(DATE_W3C); ?>" pubdate class="updated"><?php the_time('F jS, Y') ?></time></span></p> <p class="about-content"><?php the_field('about'); ?></p> </article> <?php endwhile; else: ?> <p>No events posted at this time.</p> <?php endif; ?> <div class="navigation"> <div class="next-posts"><?php next_posts_link('« Older Entries', $global_posts_query->max_num_pages) ?></div> <div class="prev-posts"><?php previous_posts_link('Newer Entries »', $global_posts_query->max_num_pages) ?></div> </div> </section>
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘404 page errors with custom post type pagination’ is closed to new replies.