Post titles of current category, shows just first five
-
Hello,
I’m using the following code to show the post titles of the current category.
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <ul> <?php $catsy = get_the_category(); $myCat = $catsy[0]->cat_ID; $IDOutsideLoop = $post->ID; global $post; $myposts = get_posts('category='.$myCat); foreach($myposts as $post) : ?> <li <?php if($IDOutsideLoop == $post->ID) print 'class="current-cat"' ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?>
But for some strange reason it just shows the last five.
Anybody has an idea why?Thanks, Ka
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Post titles of current category, shows just first five’ is closed to new replies.