Customized Pagination loop, won't show the "older posts"
-
Hi I have a pagination working with Previous and Next.
But after adding several posts, the prev, and next loop only contains a specific number of posts.
I’ve looked at the category page, and have realized this number is equal to the loops on that page. Meaning, my loop is spitting out all the posts(to the category I have set) that are “new” and not showing the “older posts.
here is a link to the category page. the loop I’ve made is dynamic, it’s in the sidebar.https://ucanusenglish.cn/category/events/
here’s my loop code.
<?php wp_reset_postdata(); // set up or arguments for our custom query $paged = ( get_query_var('page') ) ? get_query_var('page') : 1; $query_args = array( 'post_type' => 'post', 'category_name' => 'events', 'posts_per_page' => 1 ); $this_query = new WP_Query( $query_args ); ?> <div id="eventswidget"> <?php while ( $this_query->have_posts() ) : $this_query->the_post(); ?> <div> <div style="margin-bottom:10px;line-height: initial;font-weight: bold;"> <a href="<?php the_permalink() ?>"><center> <img class="eventimg" style="border-radius: 10px;box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);margin-bottom:8px;margin-top:4px" width="212" height="137" src="<?php echo catch_that_image(); ?>" ></center> <?php the_title(); ?></a></div> <?php the_excerpt(); ?> </div> <?php endwhile; wp_reset_postdata();?> </div> <div style="margin-bottom: -80px;padding-top: 30px;"> <a style="margin-right:120px" id="eventsprev" href="javascript:void(0)"> Previous</a> <a id="eventsnext" href="javascript:void(0)">Next</a> </div>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Customized Pagination loop, won't show the "older posts"’ is closed to new replies.