Advertisement
Guest User

Untitled

a guest
Jul 18th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement