Title: Excluding sticky posts
Last modified: August 20, 2016

---

# Excluding sticky posts

 *  Resolved [Bob Wagstaff](https://wordpress.org/support/users/bob-wagstaff/)
 * (@bob-wagstaff)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/excluding-sticky-posts/)
 * I’m writing a magazine style theme with a homepage consisting of a “Featured 
   Article” and then excerpts of the latest posts in two columns below the “Feature”.
 * I’m running two loops, the first one looking for a sticky post to treat as the
   feature, using this code inserted directly before my first loop:
 * `<?php if(is_home() && $post==$posts[0] && !is_paged()) { ?>`
 * This works fine, except that the sticky post also appears as the top post in 
   the second set of posts.
 * I’ve tried using the following code before the second loop to exclude the sticky:
 * `<?php query_posts(array("post__not_in" =>get_option("sticky_posts")));?>`
 * and this does remove the sticky and works fine one the homepage. But if you follow
   the navigation at the bottom to look for older posts, it simply duplicates the
   posts found on the first page.
 * What am I missing?
 * My test site is [here](http://www.blogtest.framptoncards.com/wp-test/) but I 
   have removed the second piece of coding, so that I can work on the rest of the
   site.

Viewing 1 replies (of 1 total)

 *  Thread Starter [Bob Wagstaff](https://wordpress.org/support/users/bob-wagstaff/)
 * (@bob-wagstaff)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/excluding-sticky-posts/#post-3617054)
 * Solved it myself
 * For anyone with the same issue, I replaced the second line of code with:
 *     ```
       <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       				$sticky = array(  "post__not_in" =>get_option("sticky_posts"),   'paged' => $paged );
       				query_posts($sticky); ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Excluding sticky posts’ is closed to new replies.

## Tags

 * [exclude](https://wordpress.org/support/topic-tag/exclude/)

 * 1 reply
 * 1 participant
 * Last reply from: [Bob Wagstaff](https://wordpress.org/support/users/bob-wagstaff/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/excluding-sticky-posts/#post-3617054)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
