Php 只有一个类别显示帖子-wordpress

Php 只有一个类别显示帖子-wordpress,php,wordpress,post,categories,display,Php,Wordpress,Post,Categories,Display,我对wordpress有意见。只有一个类别显示帖子。。。若我将文章分配到另一个类别,它不会显示在内容区域中。有什么不对劲吗? 以下是我的content.php文件: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="main-post"> <a href="<?php the_permalink(); ?>"> <div c

我对wordpress有意见。只有一个类别显示帖子。。。若我将文章分配到另一个类别,它不会显示在内容区域中。有什么不对劲吗? 以下是我的content.php文件:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<div class="main-post">
<a href="<?php the_permalink(); ?>">
    <div class="main-post-image" style="background-image:url('<?php echo wp_get_attachment_url( get_post_thumbnail_id() );?>')"></div>
</a>
<div class="main-post-info">
    <a class="post-author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')) ?>"><?php the_author(); ?></a>
    <a class="post-date" href="<?php the_time('j F Y'); ?>"><?php the_time('j F Y'); ?></a>
</div>
<a class="main-post-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<p class="main-post-lead"><?php the_excerpt(); ?></p>
<a class="button button-read-more" href="<?php the_permalink(); ?>">
    Czytaj więcej
    <img class="button-arrow" src="<?php echo get_bloginfo('template_url') ?>/images/button-arrow.png" alt="Czytaj więcej">
</a>


将显示哪些帖子取决于
have_posts()
之前发生的事情。这是所有的文件吗?调用了哪个路由?是的,这是所有文件。My index.php: