The Loop problems
-
Hi all.
I am trying to add a loop before the loop which shows the main page content. The problem I am having is that apart from the homepage (which works), I am getting this error instead of the contents: “Sorry, no posts matched your criteria.”
The loop looks fine to me… am I missing something obvious? (on most pages I have four different loops with no errors. This fifth one seems to cause all the errors. I wrote/modified the others a year or two ago, so it may be something obvious I have since forgotten…)
The loop I added was:
<div class="title">Affiliates</div> <div class="rtext"> <?php $AffiliateCount = 0; $Affiliates = 3; ?> <?php query_posts('cat=60'); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php if ($AffiliateCount == $Affiliates ) { } else { ?> <div class="affiliate"> <?php the_content(); $AffiliateCount = $AffiliateCount + 1; ?> </div> <?php } ?> <?php endwhile; else: ?> <div class="noaffiliate">Affiliates will go here.</div> <?php endif; ?> </div>
help?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘The Loop problems’ is closed to new replies.