bbPress loop help
-
Hi I have the following code:
<?php if ( bb_forums() ) : ?>
<?php while ( bb_forum() ) : ?>
<div class="box">
<?php if (bb_get_forum_is_category()) : ?>
<h3><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a></h3>
<?php continue; endif; ?>
<ol>
<li class="arrow f_unread">
<a href="<?php forum_link(); ?>">
<strong><?php forum_name(); ?></strong><br />
<?php forum_topics(); ?> Topics / <?php forum_posts(); ?> Replies
</a>
</li>
</ol>
</div>
<?php endwhile; ?>
<?php endif; // bb_forums() ?>Struggling to get it to work how I want which is basically like this:
for each category do this:
<div class="box">
<h3>CAT</h3>
<ol>
<li>Forum</li>
<li>Forum</li>
</ol>
</div>so that div should be repeated for each block. if a set of forums has not category, then all of the code would be above would run but just no h3.
so an example might look like this:
<div class="box">
<h3>CAT</h3>
<ol>
<li>Forum</li>
<li>Forum</li>
</ol>
</div>
<div class="box">
<h3>CAT</h3>
<ol>
<li>Forum</li>
<li>Forum</li>
</ol>
</div>
<div class="box">
<ol>
<li>Forum</li>
<li>Forum</li>
<li>Forum</li>
<li>Forum</li>
</ol>
</div>
<div class="box">
<ol>
<li>Forum</li>
<li>Forum</li>
<li>Forum</li>
<li>Forum</li>
</ol>
</div>can anyone help thanks.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- You must be logged in to reply to this topic.