While Loop Limit Post Issue
-
I understand php enough to get my self into trouble. Right now I’m in trouble. I want to pull 3 posts from a category by using a while loop. Right now it doesn’t limit it to 3. What am I doing wrong?
Here’s the code.
<?php query_posts(‘cat=4’); ?>
<?php if (have_posts()) : $count = 0; ?>
<?php while (have_posts()) : the_post(); $count <= 2; $count++; ?><h4>” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_title(); ?></h4>
<p class=”post-details”><?php _e(‘Posted on’,woothemes); ?> <?php the_time(‘d. M, Y’); ?> | ” rel=”bookmark” title=”Read More”>Read More
<hr /><?php endwhile; ?>
<?php endif; ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘While Loop Limit Post Issue’ is closed to new replies.