Skip to:
Content
Pages
Categories
Search
Top
Bottom

Same design a bbpress support forum


  • nirgalo
    Participant

    @nirgalo

    Hey, I want to set up the same kind of design bbpress support forum has for my site’s forum:
    – main page with latest topics (and page navigation), and forums as widgets on the left pane
    – when opening a forum : page with forum topics and forum info as widget on the left pane
    – topic page: topic as page and Topic info as widget

    How can I do that? Shortcodes do not seem to be enough. Like [bbp-topic-index] is only displaying the last 15 topics.

Viewing 8 replies - 1 through 8 (of 8 total)

  • Stephen Edgar
    Keymaster

    @netweb

    The [bbp-topic-index] shortcode will use the default 15 topics based on bbPress ‘Topics per page’ setting, upping this to 25 will show 25 topics per page on the topics view (example.com/topics), the topics page for each single forum and again the same for any place you use the above shortcode.


    nirgalo
    Participant

    @nirgalo

    Thanks Stephen. So I managed to get about same design for the forum’s home page, that is forums in a widget on the leftside bar, and recent topics in the page space (using the shortcode). I used a page template in a child theme for this. Now when I open a forum, I want to have forum content as the page (will use bbp-single-forum shortcode), and forum info as the widget in sidebar. But how can I set up thing so a specific sidebar appears when a forum content is being displayed?


    Stephen Edgar
    Keymaster

    @netweb

    Checkout bbPress’ ‘Conditional Tags’ https://codex.bbpress.org/bbpress-conditional-tags/

    I think they are pretty straight forwardly named so then checkout WordPress’ page and this specific sidebar example:
    https://codex.wordpress.org/Conditional_Tags#Variable_Sidebar_Content


    nirgalo
    Participant

    @nirgalo

    Is there a shortcode to display same thing as the widget used on the support forum, listing all the available forums with post count for each? I am using the forum index widget but this one is only listing the forum names.

    I guess I can write some code using bbp_list_forums, then looping over the results and usnig bbp_get_forum_post_count for each one. If there is some sample code out there to do this I’d rather use it too 🙂 Thanks.


    nirgalo
    Participant

    @nirgalo

    I am trying to use bbp_list_forums in sidebar.php in a child theme, but that doesn’t work, do I need to make some includes to get to bbpress functions?


    nirgalo
    Participant

    @nirgalo

    I got bbp_list_forums to work, but this function does seem to only list subforums! What if I want to display top level forums?


    nirgalo
    Participant

    @nirgalo

    I finally managed to get to something displaying the top level forums. Guys it took me hours to do something so simple. Really should be part of the documentation somewhere. Pasting the code here in case if helps someone:

    
    if (bbp_is_forum_archive()) {
    	$forums = bbp_get_forums_for_current_user();
    	echo '<ul>';
    	foreach ( $forums as $forum ) {
    		if ($forum->post_parent == 0) {
    		echo '<li><a href="' . bbp_get_forum_permalink($forum->ID) . '">';
    		echo $forum->post_title;
    		echo '</a></li>';
    		}
    	}
    	echo '</ul>';
    }
    

    Stephen Edgar
    Keymaster

    @netweb

    Thanks for sharing your code and and yes some more docs on this would be great.

    Anyone can add docs to the bbPress codex https://codex.bbpress.org/

    You just need to login with the same username and password you use here on bbpress.org

    https://codex.bbpress.org/wp-login.php

    Have a look at the current pages and or create a new page

    https://codex.bbpress.org/wp-admin/edit.php?post_type=page

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar