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
- Remove class that has been added by parent theme
- How to check from which page the user is coming to the current page?
- Execute only on a certain page
- Replace comment avatars and links at the same time
- Adding ads code between comments
- Create Logout Link WordPress Admin Menu
- Shortcode content filter?
- WordPress 3.2 query_posts and pagination, permalinks issue
- only show container with next/prev links if they exist?
- Error in custom php function doesn’t exist
- Can anyone offer any help with this function?
- Shortcode with PHP issue “Undefined index”
- Changing the_posts_navigation() html output
- height should be set to auto to avoid pixelation in the post thumbnail function
- Override a function defined in wp-includes/comment-template.php
- Show meta box only for default page template
- Can’t access site after making changes to the functions.php [closed]
- How do I remove a category from a wordpress loop>
- WordPress loop by meta key that is an array? and how loop multiple arrays
- child parent styles enqueue order
- Add URL parameter to all internal links using a specific theme
- Warning: call_user_func() expects parameter 1 to be a valid callback, function
- Modify WooCommerce used to get all orders in dashboard
- Gravity Forms: How to add PHP function to confirmation conditional shortcode?
- wpdb->query returns different value to phpMyAdmin
- Add Product Permalink in woocommerce admin order page
- How do I make comment-reply-button with that takes to comment reply form on click
- ERR_TOO_MANY_REDIRECTS / To Force SSL Logins and SSL Admin Access
- Allow BBPress participant role to trash topics
- Get author meta of all writers
- Replace TinyMCE with Custom Built Editor
- How to pass value to add_filter wpcf7_form_tag from another function?