You can use this code:
add_action( 'pre_get_posts', 'exclude_sticky' );
function exclude_sticky( $query ) {
if ($query->get('paged') == 0) {
$sticky = get_option('sticky_posts');
$num = get_option('posts_per_page');
$extras = $num - count($sticky);
$query->set( 'posts_per_page', $extras );
}
}
Related Posts:
- Exclude sticky post from main query?
- Show Sticky Posts in Category Archive
- Set sticky posts schedule (Automatic)
- Add a single featured post to all pages?
- Display only the most recent sticky post, display other posts in chronological order
- Exclude expired sticky posts
- Exclude Sticky posts from Main Query break Pagination
- ignore_sticky_posts in WordPress 3.0.3?
- Exclude Current and Sticky Post
- Front page should display only one category of posts including sticky post with custom featured post box
- Make sticky post on save
- Pin a post to the top of a page, other than the home page
- Why WordPress CMS uses an array in wp_options instead of a field for Sticky posts?
- ignore_sticky_posts not working with word press version 3.9.1
- How to modify query on category pages to show only sticky posts?
- Make posts non-sticky
- How to check a post is sticky or not yet?
- Custom query: how to get the sticky posts first?
- I would like to change the sticky posts label “Featured” to something else
- How to display sticky post with custom html
- Update a post to remove sticky option
- Show image if a post is featured
- I do not want my front page sticky post to show up in a category
- How to display a sticky post inside a div?
- WooThemes Mini Features – modify query_posts to display only sticky_posts
- Exclude Sticky Posts as everyone!
- Don’t move sticky posts to the first page
- Latest Sticky Posts with Grid Thumbnails for static front page
- Remove old sticky post on publish
- Limit Number of Sticky Posts to Show
- get_option(‘sticky_posts’) returns stickies that are in trash
- Display latest sticky post or display nothing
- Create thumbs only when a post is sticky or any other way?
- How can I display only sticky posts from a parent category on the homepage?
- Images for sticky posts
- Sticky Posts exceed posts per page limit
- WP_Query: Why is sticky post not first item in loop?
- Query *only* sticky posts
- Show all sticky posts, WITH pagination
- How to make my front page display only the most recent sticky post, plus usual widgets?
- How to make “sticky” pages (and query by them)
- How do I show sticky posts on a static front page that also contains content?
- Sticky posts on home page, search, tag and archives without plugin
- WordPress 3.1 – How does one add sticky post capabilities to post types
- Include Sticky Post in Page Posts Count?
- wp_query for the first sticky, then display the rest of the posts excluding the first sticky
- Sticky Posts Not Sticking to Top of Category Archive
- Randomly placed sticky custom posts complemented by blog posts
- how to make custom posts sticky? [duplicate]
- Include Sticky Posts in Page Post Count for custom query
- Query sticky posts with thumbnails
- How to remove sticky post capability for a specific user role?
- How to use custom fields to enable sticky posts on custom post types?
- WP_Query doesn’t get sticky post at the top, when used in a page template
- Ignore sticky posts if post is not in meta query
- Store sticky post’s ids in a transient
- Show Sticky Post at the top but do not show again in the loop?
- Move sticky posts down in main loop
- wp_query should show stickies first
- How to stick custom post at the top in search results
- Woocommerce – Want to move the product tabs below short description
- Include sticky posts on the static page front page
- Sticky posts per category
- How to display only feautured/sticky listings on the homepage
- Showing sticky posts with get_posts()
- Difficulty with PHP function that displays a post’s format in WordPress
- Custom loops, sticky posts, and pagination nightmare
- Sticky post for each category on category pages [duplicate]
- Only display sticky post or latest post in custom loop
- How to get bbpress sticky topics
- How to automate featured posts number? [duplicate]
- Exclude duplicated $sticky post from combined loop content
- Exclude current sticky post
- Why: sticky front page code, shows latest non-sticky on logged-in front page
- Can’t get pagination to work for sticky posts only
- Sticky option for custom post types without using custom fields or plugins
- How to display sticky or latest published post on the current category page it belongs to?
- Knowing if a post is sticky in the ‘save_post’ action. Where do I have to hook?
- Get all sticky posts from one user through user ID
- Sticky posts don’t show up first in custom loop
- Make posts_per_page value the same on all pages
- Custom loop off by one post
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- WordPress Sticky Post Count “Fix” Breaking Pagecount by 72 pages!
- Display Specific Posts at Start of Loop
- How to display sticky post always at the top (before regular post) in wordpress?
- Staggering featured post using ‘sticky’
- Seach and categories not working when ignoring sticky posts in main loop
- Pin to Top Functionality using orderby custom field then event date
- How to display only sticky posts on category pages?
- WP Query with sticky posts and tax_query
- Show sticky blog post on homepage
- Show sticky post before other WP_Query
- How to change text (date) in post base on the day
- Multiple loops on index page with sticky post and pagination
- Multiple loops with / without sticky posts and different post limits
- How can I display sticky posts at first in wp_query?
- Pagination not working only on Archive-Name.php using new WP_Query
- Why ignore_sticky_posts argument is in sticky post query?
- How to show sticky posts on all pages of the pagination, not just the first page?