I had faced the same problem. And finally, I solved the problem.
Getting the current Pagination Number
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
For getting the current pagination number on a static front page (Page template) you have to use the ‘page’ query variable.
<?php $paged = (get_query_var('page')) ? get_query_var('page') : 1; ?>
So you should use the get_query_var('page')
instead of get_query_var('paged')
.
You can use is_front_page()
function in if condition for frontpage query. Just as like-
<?php
if(is_front_page()) {
$paged = (get_query_var('page')) ? get_query_var('page') : 1;
}else {
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
}
Credit goes here
Related Posts:
- Skip 5 latest post while paging?
- Home page loop with pagination problem
- How to fix pagination for custom loops?
- Remove the Homepage Query
- is_home, and is_front_page conditional problem
- WordPress category & taxonomy loop with pagination
- How do I prevent one of two multiple loops from repeating on a second page?
- Two custom loops, pagination, offset
- Pagination Not working on Home Page with 2 Query
- Previous and Next Post link doesn’t work
- Pagination adding extra posts only on page 2
- multiple loops with pagination on the same page
- Enable infinite scroll on single.php [closed]
- How to paginate this custom loop? [duplicate]
- Make a custom loop inside single.php with pagination
- Why do I get `Call to a member function have_posts() on a non-object `? [closed]
- Pagination gives extra page with no results
- Get Pagination (WP-PageNavi) not to work
- Better way to display posts from specific categories, in a grid layout
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- Complex query and posts pagination
- Why only one post (and no pagination) on this variation of the loop?
- Recent posts on a static home page
- Calling & display certain product category loop and pagination on the homepage
- Make blog page show 10 on first page, 9 on every other page
- Pagination for multiple loops
- How to fix pagination for custom loops?
- How can I paginate this?
- Genesis multiple category custom loop 404s after first page
- How to fix pagination for custom loops?
- Pagination – works on local but not live dev!
- Page-loop is looping content from custom loops on the same site. How to avoid that?
- How do I paginate a get_posts() request inside another page loop (Paginating childpages)
- Pagination on Single Post
- How to get my loop to paginate?
- Distribute Gallery Images Every nth in Loop
- How to exclude or filter password protected posts when using next_post_link() previous_post_link
- How to append a query string to pagination?
- How do I get my loop.php to properly paginate?
- First archive page with a few posts
- Pagination broken after using 2 loops to show content
- Pagination on custom post type on front-page.php
- How do I put my frontpage featured image in a page template for home.php?
- I have broke my pagination, same posts on all pages (index.php)
- Display post formats differently on index.php (loop in function)
- WordPress loop not working only on home page, works on all other pages
- Frontpage pagination by week
- How can this multiple loop have pagination as described?
- Display more than 10 posts on author.php file
- WP_Query is only looping home page, not pages
- static page with multiple loops breaks post pagination
- Pagination for two loops
- Why does my WP_Query pagination on a custom page.php only loads the homepage?
- How to insert content before pagination in loop?
- Pagination on a underscore custom theme
- WordPress multiple loops with default pagination
- How to fix pagination for custom loops?
- Style first 3 posts differently and use a 2nd loop to get rest of posts / offset and pagination broken
- Homepage Loop Somehow Breaks Styling Of Post Grid
- Custom loop not working in singular.php, working in other pages
- Alternative layout the loop
- Echo Most Recent Sticky Post in Loop?
- How to fix pagination for custom loops?
- Adding pagination to WP_Query [duplicate]
- How to fix pagination for custom loops?
- How to fix pagination for custom loops?
- Why is my pagination showing up?
- 2 loops in blog homepage
- Displaying posts limit: can’t get pagination to display [duplicate]
- Paged homepage – requirements?
- WooCommerce custom loop pagination on front page
- Different style for first two (sticky) posts
- posts_nav_link() not working on index.php
- Custom Page Template and Category Exclusion
- repeating posts on 2nd page to posts
- Limitless amount of posts in custom archive page
- Same posts within a paginated page
- Multiple loop with pagination in same page
- Insert multiple custom components after x-number of posts
- Redirect loop when trying to login to /wp-admin/ [duplicate]
- Changing behavior of the loop twice in one page
- Pagination not working Search posts
- Displaying child page content of a certain parent
- Sort Posts By Category?
- How to use current_post to open a new unordered list every five posts
- Rating system and changing the loop
- Blog post per page setting conflicting with custom WP_Query?
- How to target thumbnails of the first post in the loop
- Multiple Loops on category.php with pagination on last loop
- Use two different post_per_page limits with infinite scroll
- Include multiple page ids in loop
- For each loop on every word in post
- Display name of taxonomy once
- How to use this $tax_selection variable in this custom loop?
- Display all categories as plain text
- Posts Per Page is Not Returning Correct Number
- The Loop isn’t working
- stuck with template hierarchy
- How to create an identical second loop for attachments?
- pull 500 post of many from database [duplicate]