Chances are your pager is getting the count of all posts, regardless of whether they are published. In your query, you should add a filter for only published posts.
$query_args = array(
'post_type' => 'post',
'posts_per_page' => 4,
'paged' => $paged,
'post_status' = 'publish',
);
Then the results count and number of pager links should match what you actually see rendered.
Related Posts:
- Blog posts repeat
- How can I get my pagination loop to display the correct number of total pages?
- What is This esc_html_e() i wordpress php?
- Modify previous and next text from pagination links
- Build a content and excerpt grid loop with paging and options for # of posts
- Displaying post per day
- Rewriting search and pagination base
- How to add active class to custom menu using while loop and wp_list_pages
- WooCommerce – Customer Order History Pagination
- Custom Loop Pagination on WordPress
- delete an array element when its date expires
- How can I loop into two different DIVS without repeating the DIVs
- get understrap pagination to work with custom query
- Getting rid of role=”navigation” in the Home Page Pagination
- How to speed up a wordpress function with multiple loops?
- Custom excerpt function re-factoring
- How can I add pagination and how can I change thumbnail size?
- Get first URL from post content
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Using loop pagination on single.php
- Show css depending on activity type in BuddyPress activity-loop [closed]
- get author_name from queried post
- how to refresh div on template part?
- Search not showing all results
- Can’t find infinite loop cause
- Checking array against author id in loop
- Pagination on Custom Post
- 2nd page displaying the exact same posts as my first page (minus the very first post)
- Prev/Next Links Broken on Static Front Page Pagination
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- use loop to return blog details
- How to get current post category details inside “loop”?
- Custom query vars filters problem with pagination
- Calling function in loop causes repeat data
- WordPress loop is not working
- How to add PHP pagination to wordpress
- pagination broken – clicking next displays “page not found”
- Strip from or something better?
- Pagination Not Working (pages duplicating content)
- How to Add a cutsom slug to my custom author role
- How do I get pagination for get_posts() in WordPress or do I have to rewrite the whole code?
- Products listing check if meta checkbox is checked
- Pagination contents not changing in Front page WordPress
- How to output the taxonomies that are assigned to each custom post?
- Pagination not working in custom post type. Help
- update_user_meta as multiple value but with same meta key
- cURL needing to loop through all “next_page”
- Pagination 404 error(I have refreshed the permalinks and tried several previous options)
- WordPress Ajax filter: Create two loops for different output styles?
- WordPress Recent Posts – Loop
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Get current_post in reverse order with pagination
- How fix error in the WordPress loop?
- My query keeps looping infinitely ! how to stop it?
- Retrieving specific images from Media Library
- Modify category archive page loop on functions.php
- How to fix blank pagination links?
- Inserting A Feed and Sidebar into an HTML Page
- Pagination on Custom Loop
- Pagenav Not appearing on custom Template
- Pagination not displaying
- WordPress post pagination on custom template not working
- Pagination in category.php not functioning
- Options.php loop won’t show!
- Loop on a wordpress Page instead of content coming from the WP text editor
- How do I remove blog entries from home page Twenty Eleven child theme?
- Pagination not working properly
- /page/2/ redirect to 404
- Change MySQL PDO connection to a WPDB connection
- Call to undefined function error in plugin
- How to get post category list as select in front-end?
- How do I correct the code in php? [closed]
- How to make a cookie be on the whole site instead of being on a specific page/
- Custom pagination (Previous / Next)
- How to use functions [closed]
- PHP Output also in Child theme, but different
- Splitting the_content() by size?
- Image rotation issue (horizontal picture uploading as vertical) — Exif issue?
- Fallback image URL if no featured image exists via a shortcode function
- Limit tags shown in post
- How to style injected code in header section?
- Is there a hack for using is_page() within the function.php file?
- Query for user roles
- WordPress call post-ID in jquery
- Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS
- how to enqueque code in a php file from functions.php
- How to Generate a list of Most Commented post?
- Class property seems to lose scope, attached to save_post action?
- Randomize Color Scheme Selection in Theme
- Extract and display user infromation on an automatically created page
- Must filter functions receive all arguments passed to them?
- Custom Taxonomy Select Menu: Setting default option value?
- How to add author’s posts link (HTML + PHP) inside a function to output it
- Is it legal to redefine wp_password_change_notification in a mu plugin?
- How to extract information from a wp_query result?
- How to Display a List of Child Pages For a Parent Page in WordPress
- Only load certain artists on this page
- Nav-Menu not showing up
- Show different website layout if no sidebar added
- Creating customized php files in theme folder