开发者

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();
?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜