Info
- 7 posts
- 3 voices
- Started 2 years ago by gerikg
- Latest reply from psycheangels
- This topic is not resolved
Forum Names immitate wp_list_pages()
-
- Posted 2 years ago #
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? -
- Posted 2 years ago #
-
- Posted 2 years ago #
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"
-
- Posted 2 years ago #
i dont understand with your second question.
maybe you can give me an example forum page. -
- Posted 2 years ago #
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?
-
- Posted 2 years ago #
-
- Posted 2 years ago #
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; ?>"> -
You must log in to post.