I would like help getting my pagination to work
Try $_GET[‘paged’] instead of $_GET[‘page’]
Try $_GET[‘paged’] instead of $_GET[‘page’]
Pagination URL in Custom Content Type
Pagination for Custom Taxonomy
It’s hard to answer exactly, because themes vary. But typically index.php is not the one that is used for your blog archive / front page. It is there as a fallback. Many themes have a “front-page.php” or a “home.php” that contains the blog archive / front page code. If you have a static front page … Read more
Your problem is that you use core url parameters (paged in this case) for something that is not the main loop. There are two possible solutions instead of writing your own loop, use the pre_get_posts filter to modify the main loop. Use your own pagination parameters (for example jr_paged).
To do this, you will need to: Use 2 queries not 1 100% custom pagination, the built in pagination functions will never work with this, WP has no concept of 2 post main loops Custom URLs But before we go into this A Significantly Easier Alternative That’s Nicer for Users Just list the first 5 … Read more
So I just found this filter: the_posts https://codex.wordpress.org/Plugin_API/Filter_Reference/the_posts Send it to a function, and the first parameter is the entire post page with the pagebreak. My plan is to run it through regex, delete the first occurence of the <!–nextpage–> and return it. I’ll see if that works
$limit = 5; if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); if ( in_array( get_the_ID(), $posts_to_exclude, true ) && $limit > 0 ) { continue; } $limit–; the_title(); endwhile; endif;
the_posts_pagination works with the global $wp_query, so your second method will not work. query_posts modifies the main query but the arguments passed will overwrite any existing values, so all values needed for pagination are lost when you set cat=5. But you can preserve the existing values by modifying the global query string. A more efficient … Read more
You should insert post navigation manually. Update functions.php of your theme with add_filter(‘the_content’, function($content) { return $content . get_the_post_navigation(); }); Or insert the_post_navigation() in desirable place in your single.php template. You should create child theme to be able update primary theme.