Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 18th, 2013  |  syntax: PHP  |  size: 0.52 KB  |  views: 33  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $query_options = array(
  2.         'post__in'              => get_option('sticky_posts'),
  3.         'meta_query'            => array(
  4.                                         array('key' => '_thumbnail_id')
  5.                                 )
  6. );
  7.  
  8. $stickies = new WP_Query( $query_options );
  9.  
  10. echo "<p>post_count is $stickies->post_count and found_posts is $stickies->found_posts</p>";
  11.  
  12. if( $stickies->have_posts() ):
  13. ?>
  14.         <div id="slider">
  15.         <?php while( $stickies->have_posts() ) : $stickies->the_post(); ?>
  16.                 <div>Slider content for <?php the_title(); ?> omitted</div>
  17.         <?php endwhile; ?>
  18.          </div>
  19. <?php   endif;
clone this paste RAW Paste Data