Not all posts show up under category
-
So there are 4 categories on my blog. To make things simple let’s just call them category 1, 2, 3 and 4. The problem is with posts being in two categories at the same time. In that case posts from other categories won’t show up anymore.
Example:
Post A is in the cateogries 1AND 2.
Post B is in category 2 only.
Now, when I click on category 2 all posts from category 2 only are gone. The only thing I see is post A and all the other posts which belong to category 1 AND 2. So post A has somehow suppressed post B.Here is the code being used for every category:
<!-- Loop--> <?php $current_cat = get_the_category(); $cat_ID = $current_cat[0]->cat_ID; $loop = new WP_Query(array('offset' => 1,'cat' => $cat_ID)); if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post(); ?> <div id="loopcontent"><a href="<?php esc_url( the_permalink() ); ?>"> <div id="content" class="article" <?php //Thumbnail-Hintergrund if ( $thumbnail_id = get_post_thumbnail_id() ) { if ( $image_src = wp_get_attachment_image_src( $thumbnail_id) ) printf( ' style="background-image: url(%s);"', $image_src[0] ); } ?>> <div id="backgroundlayer"> <h1><?php the_title(); ?></h1> <div class="date"><php echo get_the_date(); ?><p></div> <div class="clear"></div> </div></a> </div> <?php endwhile; ?> <div class="clear"></div> <?php endif; ?> <!-- End Loop -->
I am googling for hours and days now and couldn’t figure out what the problem is. So any help is very much appreciated. Thanks.
- The topic ‘Not all posts show up under category’ is closed to new replies.