Ajax pagination not working
-
Ajax pagination not working. If you click the next button the url changes to the page/2/ but posts dont it’s still the first page
Here is my home.php<div class="tmpl-blog"> <div class="top-title"> <h2>BLOG OFFSHORE</h2> </div> <div class="clear"></div> <?php get_template_part( 'templates/main', 'post' ); ?> <div class="recent-posts" id="main"> <div class="title"> <p class="fancy"><span>RECENT POSTS</span></p> </div> <div class="posts-grid"> <?php $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $args = array( 'category_name' => 'posts', 'posts_per_page' => 4, 'paged' => $paged ); $main_query = new WP_Query($args); while ($main_query->have_posts()) : $main_query->the_post(); get_template_part( 'templates/content', 'blog' ); endwhile; ?> </div> <div class="posts-pagination"> <?php the_posts_pagination( array( 'mid_size' => 2, 'prev_text' => __( 'Previus', 'textdomain' ), 'next_text' => __( 'Next', 'textdomain' ), ) ); ?> <?php wp_reset_postdata(); ?> </div> </div> <div class="popular-posts"> <h2>MOST POPULAR POSTS</h2> <?php dynamic_sidebar('popular-posts'); ?> </div> </div> <?php dynamic_sidebar('module-faq'); ?> <?php dynamic_sidebar('module-contact-form'); ?>
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Ajax pagination not working’ is closed to new replies.