Post Loop
-
Here is the code I am using for my post.
<?php $recent = new WP_Query("cat=1&showposts=4"); while($recent->have_posts()) : $recent->the_post();?> <div class="post"> <h2 class="postTitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> <div class="postMeta"> <span class="date"><?php the_time('M.d, Y') ?></span> in <span class="filed"><?php the_category(', '); ?></span> <span class="commentcount"><?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?></span> </div> <div class="postContent"><?php the_content(); ?></div> </div> <!-- Closes Post --> <?php endwhile; ?>
but if I try to add
<?php else; ?>
it throws an error. Where am I going wrong
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Post Loop’ is closed to new replies.