One php look screwing up my main loop? Help please!!
-
I’m trying to frankenstein a template together, and I wanted to add a category bar on the main page, below what will be the featured space. When I DON’T have the code in place, I get a normal listing of the articles and page navigation. When I DO put the code in, I only get one article showing.
Since I don’t know exactly what I’m doing, I’d appreciate any help I can get!
Here’s the offending code, which does the job of displaying the menu, but killing the content:
‘ <div id=”catguide” class=”clearfloat”>
<?php $display_categories = array(5,3,4,22,6); $i = 1;foreach ($display_categories as $category) { ?><div id=”cat-<?php echo $i; ?>” class=”category”>
<?php query_posts(“showposts=1&cat=$category”)?>
<span class=”cat_title”>“><?php single_cat_title(); ?></span>
“><?php echo category_description($category); ?>
</div><?php $i++; ?>
<?php } ?>
</div>’
- The topic ‘One php look screwing up my main loop? Help please!!’ is closed to new replies.