My category Loop displays Posts from other categories!?
-
Hey Guys,
this is my category.php file:
<?php get_header(); ?> <div class="entry"> <h2><?=array_shift(get_the_category())->cat_name?></h2> <?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query('paged='.$paged."&category_name=".array_shift(get_the_category())->cat_name."&request=category"); ?> <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <div class="entries"> <h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1> <?php the_content(); ?> </div> <?php endwhile; ?> </div> <div id="paging"><? get_pagination();?> </div> <?php get_footer(); ?>
on some category pages it’s working fine. but on one i have displayed not only posts of the current category. and the
array_shift(get_the_category())->cat_name
also shows the wrong category.thanks for help …
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘My category Loop displays Posts from other categories!?’ is closed to new replies.