分类法术语循环,显示术语的所有帖子,而不仅仅是一个

时间:2015-04-01 20:31:07

标签: php wordpress taxonomy posts

我有一个问题,我有一个名为类别的分类,以及其中的术语。在这个分类法的页面上,我想显示该术语的每个帖子。但是通过我所做的这个循环,只有好词的第一个帖子显示在页面上。所以我不知道为什么我的循环没有显示该术语的每个帖子。

这是我的代码:

<?php $term=get_term_by('slug',get_query_var('term'),get_query_var('taxonomy')); ?>
                    <?php if (have_posts()): while(have_posts()): the_post(); ?>
                <div class="article-menu a-m-sp">
                    <a href="<?php the_permalink(); ?>">
                        <span class="rollover r2"> </span>
                    <?php the_post_thumbnail(array(226,150)); ?>
                    </a>
                    <div class="right p-special">
                        <h2 class="h2-article-menu h2-ma"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                    <p class="date"><?php pll_e('Publié le ') ?> <?php the_time('j F Y'); ?></p>
                    <?php the_excerpt(); ?>
                    <a href="<?php the_permalink(); ?>" class="sl8"><?php pll_e('Lire la suite') ?></a>
                    </div>

                </div>
                <?php endwhile; ?>
                <?php endif; ?>
            </article>

            <?php get_footer(); ?>

感谢您的帮助。我是一个wordpress初学者。

0 个答案:

没有答案
相关问题