title: WordPress sticky post not showing
body: <p>In my Index.php template file I have the following code which should show a featured post if it's sticky and then loop through the remaining posts below. However on the second loop shows anything and the sticky post does not appear...</p>
  
  <p>The post has definitely been made sticky and second loop has successfully hidden it but the first loop just doesn't acknowledge it :/ it's not set to private and is marked as published.</p>
  
  <p>Can anyone see any issues with the code? Thanks</p>
  
  <pre><code>&lt;?php get_header(); ?&gt;
  &lt;div class="clearfix"&gt;
      &lt;?php if(is_home()) { //if home then show the featured post and others ?&gt;
      &lt;div class="main-column"&gt;
          &lt;?php
              $sticky = get_option( 'sticky_posts' );
              $sticky_query = new WP_Query( 'p=' . $sticky[0] );
              // The Loop
              while ( $sticky_query-&gt;have_posts() ) : $sticky_query-&gt;the_post(); ?&gt;
                  &lt;div class="featured"&gt;
                      &lt;article class="clearfix"&gt;
                          &lt;h2&gt;&lt;a href="&lt;?php echo get_permalink() ?&gt;"&gt;&lt;?php echo $post-&gt;post_title ?&gt;&lt;/a&gt;&lt;/h2&gt;
                          &lt;p class="who-when"&gt;by &lt;?php echo get_the_author_meta('first_name'); ?&gt; &lt;?php echo get_the_author_meta('last_name') ?&gt; on &lt;?php echo get_the_date() ?&gt; &lt;/p&gt;
                          &lt;?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
                              echo '&lt;a href="'.get_permalink().'"&gt;';
                              the_post_thumbnail();
                              echo '&lt;/a&gt;';
                          } else {
                              echo '&lt;a href="'.get_permalink().'"&gt;&lt;img src="'. get_bloginfo('template_directory') .'/images/thumb-placeholder.png" alt="Blog thumbnail" /&gt;&lt;/a&gt;';
                          }?&gt;
                          &lt;p&gt;&lt;?php the_excerpt_max_charlength(300) ?&gt;&lt;/p&gt;
                      &lt;/article&gt;
                  &lt;/div&gt;
              &lt;?php endwhile; ?&gt;
  
              &lt;div class="articles"&gt;
              &lt;?php $query = new WP_Query( array( 'post__not_in' =&gt; get_option( 'sticky_posts' ), 'posts_per_page' =&gt; 10 ) );
              $count = 0;
  
              while ( $query-&gt;have_posts() ) : $query-&gt;the_post();
              $count++; ?&gt;
                  &lt;div &lt;?php if($count % 2 == 0) echo 'class="no-margin"' ?&gt;&gt;
                      &lt;article&gt;
                          &lt;h2&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php echo $post-&gt;post_title ?&gt;&lt;/a&gt;&lt;/h2&gt;
                          &lt;p class="who-when"&gt;by &lt;?php echo get_the_author_meta('first_name'); ?&gt; &lt;?php echo get_the_author_meta('last_name') ?&gt; on &lt;?php echo get_the_date() ?&gt; &lt;/p&gt;
                          &lt;?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
                              echo '&lt;a href="'.get_permalink().'"&gt;';
                              the_post_thumbnail();
                              echo '&lt;/a&gt;';
                          } else {
                              echo '&lt;a href="'.get_permalink().'"&gt;&lt;img src="'. get_bloginfo('template_directory') .'/images/thumb-placeholder.png" alt="Blog thumbnail" /&gt;&lt;/a&gt;';
                          }?&gt;
                          &lt;p&gt;&lt;?php the_excerpt_max_charlength(150) ?&gt;&lt;/p&gt;
                      &lt;/article&gt;
                  &lt;/div&gt;
              &lt;?php if($count % 2 == 0) echo '&lt;hr/&gt;' ?&gt;
              &lt;?php endwhile; ?&gt;
              &lt;/div&gt;
  
      &lt;?php }else if(is_search() || is_category || is_tag()){ //if other than home (search, tag, category) then show normal list (no featured style) ?&gt;
      &lt;div class="main-column search"&gt;
              &lt;?php 
              $count = 0;
              if(is_search()){
                  echo '&lt;h1&gt;Search Results&lt;/h1&gt;';
              } elseif(is_author()){ ?&gt;
  
  &lt;?php $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author)); ?&gt;
  
          &lt;h1&gt;&lt;?php echo $curauth-&gt;user_firstname; ?&gt; &lt;?php echo $curauth-&gt;user_lastname; ?&gt;&lt;/h1&gt;
  
      &lt;div class="archive-meta"&gt;
          &lt;p&gt;&lt;?php echo $curauth-&gt;user_description; ?&gt;&lt;/p&gt;
      &lt;/div&gt;
  
  
              &lt;?php } else if(is_category()){ ?&gt;
  
  
              &lt;h1&gt;&lt;?php single_cat_title( '', true ); ?&gt;&lt;/h1&gt;
              &lt;?php
                  $category_description = category_description();
                  if ( ! empty( $category_description ) )
                      echo '&lt;div class="archive-meta"&gt;' . $category_description . '&lt;/div&gt;';
              ?&gt;
  
  
              &lt;?php }else if (is_tag()){
                  echo '&lt;h1&gt;'.the_tag().'&lt;/h1&gt;';
              }
              if ( have_posts() ) : while ( have_posts() ) : the_post();
              $count++; ?&gt;
              &lt;div&gt;
                  &lt;article&gt;
                      &lt;h2&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php echo $post-&gt;post_title ?&gt;&lt;/a&gt;&lt;/h2&gt;
                      &lt;p class="who-when"&gt;by &lt;?php echo get_the_author_meta('first_name'); ?&gt; &lt;?php echo get_the_author_meta('last_name') ?&gt; on &lt;?php echo get_the_date() ?&gt; &lt;/p&gt;
                      &lt;?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
                          echo '&lt;a href="'.get_permalink().'"&gt;';
                          the_post_thumbnail();
                          echo '&lt;/a&gt;';
                      } else {
                          echo '&lt;a href="'.get_permalink().'"&gt;&lt;img src="'. get_bloginfo('template_directory') .'/images/thumb-placeholder.png" alt="Blog thumbnail" /&gt;&lt;/a&gt;';
                      }?&gt;
                      &lt;p&gt;&lt;?php the_excerpt_max_charlength(300) ?&gt;&lt;/p&gt;
                  &lt;/article&gt;
              &lt;/div&gt;
              &lt;?php endwhile; else: ?&gt;
               &lt;p&gt;Sorry, no posts matched your criteria.&lt;/p&gt;
               &lt;?php endif; ?&gt;
           &lt;?php } ?&gt;
       &lt;/div&gt;
      &lt;?php get_sidebar(); ?&gt;
  &lt;/div&gt;
  &lt;?php get_footer(); ?&gt;
  </code></pre>