Attempt at a multiple loop
-
Hi guys,
This is the loop I’ve tried to create for slight changes in the display of posts in three different categories. Each of these categories has its own menu button, but all use the same one-column template from TwentyTen.
I have no idea whether this might work. Could anyone give me a hint?
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( in_category( ‘A’ )) ; ?>
<h2 class=”entry-title”><?php the_title(); ?></h2><div class=”entry-content-A”>
<?php the_content(); ?>
</div><?php endif; ?>
<?php elseif ( in_category( ‘B’ )) ; ?>
<h2 class=”entry-title”><?php the_title(); ?></h2><div class=”entry-content-B”>
<?php the_content(); ?>
</div><?php endif; ?>
<?php elseif ( in_category( ‘C’ )) ; ?>
<h2 class=”entry-title”><?php the_title(); ?></h2><div class=”entry-content-C”>
<?php the_content(); ?>
</div><?php endif; ?>
<?php endwhile; ?>
-
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.
If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.
If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.
This is an automated message.
- The topic ‘Attempt at a multiple loop’ is closed to new replies.