2011-12-05 110 views
0

我已创建分离页说:“service.php”与下面的代码如何使用wordpress为特定页面分配特定帖子?

<?php /* Template Name: services */ ?> 
......//code 
...... 

所以上面的页面现在作为独立的静态页面。 现在我想为wordpress中的此服务页面分配特定的帖子。

有没有可能这样做?

请在此建议。

回答

1

如果没有其他querys在页面上...

简单...

<?php query_posts('p=5'); ?> 

    <?php if (have_posts()) : ?> 
     <?php while (have_posts()) : the_post(); ?> 

     <!-- Do stuff here -->     

     <?php endwhile; endif; ?> 
    <?php wp_reset_query(); ?> 

凡说P = 5 - 这是后ID号。

相关问题