/page/2/ redirect to 404
/page/2/ redirect to 404
/page/2/ redirect to 404
The reason it’s rewriting ?paged=2 to /page/2 is because you’re using a page template on a page, and pages support paginated content. You can insert read more page breaks and have multiple pages of content. Because of this, WordPress has pretty permalinks for that pagination. It has nothing to do with wether your site uses … Read more
Two pagination in one page without AJAX
How to change `page` slug in pagination? on a specific pagination result (not globally)
Search results stuck on page 1
A certain chatty AI found me a solution. add_action( ‘wp_footer’, ‘custom_pagination_script’ ); function custom_pagination_script() { ?> <script type=”text/javascript”> jQuery( document ).ready( function( $ ) { $( ‘.page-numbers a’ ).click( function( event ) { event.preventDefault(); var link = $( this ).attr( ‘href’ ); window.location = link + ‘#d3c-psf-products’; } ); } ); </script> <?php } add_action( … Read more
how to update pagination after ajax call page 2 show 0
I actually had a duplicate of $page = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
Put this code <div class=”row”> <div class=”col-md-8 col-md-offset-2″> <?php $args = array( ‘posts_per_page’ => 3, ‘post_type’ => ‘work’, ‘paged’ => get_query_var(‘paged’) ? get_query_var(‘paged’) : 1 ); $myposts = new WP_Query($args); ?> <?php single_term_title(); ?> <?php if ( $myposts->have_posts() ) : ?> <?php while ( $myposts->have_posts() ) : $myposts->the_post(); ?> <?php get_template_part( ‘content’, get_post_format() );?> <?php … Read more
It always displays the first page because you tell it to: ‘paged’ => ‘1’ 🙂 That said changing main query and especially pagination inside a template is inherently unreliable. For proper customization of such you should always be adjusting main query before template is ever reached via appropriate hooks, typically pre_get_posts.