【发布时间】:2013-08-19 11:03:52
【问题描述】:
下午好,我正在尝试在模板中使用 PHP 显示帖子,但我使用相同的模板根据年龄 ID 输出不同的帖子。
我目前有这个有效的代码...
<?php //GET MEMBERS ?>
<?php query_posts('category_name=members&orderby=date'); ?>
<div class="row-fluid">
<ul class="thumbnails">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li class="span4">
<div class="thumbnail">
<?php // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail();
?>
<div class="pad">
<h3><?php the_title(); ?></h3>
<?php the_content(); ?>
</div>
</div>
</li>
<?php endwhile; ?>
</ul>
</div>
<?php endif; ?>
但我需要根据页面 ID 输出不同的“类别”... E.G
如果页面 id 是 7 echo "php script" 否则页面 id 为 13 echo "不同的 php 脚本"
谢谢,布拉德
【问题讨论】: