Wordpress:Echo PHP取决于页面ID
下午好,我尝试在模板中使用PHP显示帖子,但我使用相同的模板根据年龄ID输出不同的帖子 我目前有这个代码的工作Wordpress:Echo PHP取决于页面ID,php,wordpress,posts,Php,Wordpress,Posts,下午好,我尝试在模板中使用PHP显示帖子,但我使用相同的模板根据年龄ID输出不同的帖子 我目前有这个代码的工作 <?php //GET MEMBERS ?> <?php query_posts('category_name=members&orderby=date'); ?> <div class="row-fluid"> &
<?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输出不同的“类别”。。。例如
如果页面id为7,则回显“php脚本”
else页面id为13 echo“不同的php脚本”
谢谢,Brad有一些内置功能。您可以使用
get_the_ID()
返回要在if语句中使用的ID号
问候