Forums

Join
bbPress Support ForumsTroubleshootingForum Names immitate wp_list_pages()

Info

Tags

Forum Names immitate wp_list_pages()

  1. Two part question

    1. Is there a code to imitate wp_list_pages('title_li=') with the forum names?
    result in...

    <li><a href="http://bbpress.org/forums/forum/installation">Installation</a></li>
    <li><a href="http://bbpress.org/forums/forum/troubleshooting">Trouble Shooting</a></li>

    etc etc...
    2. How do you add class=selected to current forum page?

  2. Yes, thank you! I edited to fit my needs.

    with this code

    <?php if ( bb_forums() ) : 	while ( $depth = bb_forum() ) : if( $depth > $last_depth ) : ?>
    <?php echo str_repeat("	",$depth) ?>
    <?php else : ?></li>
    <?php while( $depth < $last_depth ) : echo str_repeat("	",$depth+1) ?>
    <?php echo str_repeat("	",$depth) ?></li>
    <?php $last_depth--; endwhile; endif; if (bb_get_forum_is_category()) :
    			echo str_repeat("	",$depth) ?><li class="forum_cat"><a href="<?php forum_link() ?>" title="<?php forum_description(array('before'=>'','after'=>'')) ?>"><?php forum_name() ?></a>
    <?php else :
    			echo str_repeat("	",$depth+1) ?><li class="forum_subforum"><a href="<?php forum_link() ?>" title="<?php forum_description(array('before'=>'','after'=>'')) ?>"><?php forum_name() ?></a>
    <?php endif; 	$last_depth = $depth; endwhile ?>
        </li>
    	</ul>

    # 2. how do I make the current forum have a class="selected"

  3. i dont understand with your second question.
    maybe you can give me an example forum page.

  4. Okay I will have on my header the Forum Names as "Pages"

    Installation - Troubleshooting - Themes - Plugins - etc

    When I'm on the Troubleshooting page (http://bbpress.org/forums/forum/troubleshooting) the class of trouble shooting will be "selected".

    <li><a href="http://bbpress.org/forums/forum/installation">Installation</a></li>
    <li><a href="http://bbpress.org/forums/forum/troubleshooting" class="selected">Trouble Shooting</a></li>

    make sense?

  5. before the loop
    $forumselect = get_forum_id();
    and in the loop
    <li class="<?php if ( get_forum_id() == $forumselect ) : ?>selected<?php else: ?>forum_subforum<?php endif; ?>">

  6. You must log in to post.