0
我已创建分离页说:“service.php”与下面的代码如何使用wordpress为特定页面分配特定帖子?
<?php /* Template Name: services */ ?>
......//code
......
所以上面的页面现在作为独立的静态页面。 现在我想为wordpress中的此服务页面分配特定的帖子。
有没有可能这样做?
请在此建议。
我已创建分离页说:“service.php”与下面的代码如何使用wordpress为特定页面分配特定帖子?
<?php /* Template Name: services */ ?>
......//code
......
所以上面的页面现在作为独立的静态页面。 现在我想为wordpress中的此服务页面分配特定的帖子。
有没有可能这样做?
请在此建议。
如果没有其他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号。