Retrieve certain posts by their number?
How can I call certain posts by their number to place them as featured posts in specific places of my template ? I've read about sticky posts , But I have about 3 places to place my featured posts and I guess I need a loop to get posts 开发者_C百科by their number I defined.
Any HELP ?!
<?php
// The Query
$query = new WP_Query( 'p=7' );
// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post();
echo '<li>';
the_title();
echo '</li>';
endwhile;
// Reset Post Data
wp_reset_postdata();
?>
精彩评论