下午好,我正在尝试在模板中使用 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 输出不同的“类别”...... EG
如果页面 id 为 7,则回显“php 脚本”,否则页面 id 为 13,则回显“不同的 php 脚本”
谢谢,布拉德