Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum index

  • @dottedpixel

    Participant

    I would like to have a forum index as seen on this page: singletrackworld
    Overview, Forum 1, Forum 2, Forum 3, etc

    I am googling since days to find a solution but did not find anything.

    I would appreciate any help leading me in to the right direction.

    Best
    Michel

Viewing 16 replies - 1 through 16 (of 16 total)
  • @robkk

    Moderator

    @dottedpixel

    could you highlight what you want exactly

    cause im not sure what you want , the way the forums itself display?

    or the links above the forum that display each forum name? <–thats really easy

    you could probably do the other thing with shortcodes

    @dottedpixel

    Participant

    @robkk
    Thanks for your quick answer.
    the links above the forum that display each forum name?
    Yes thats what I would like to do.

    Best
    Michel

    @robkk

    Moderator

    its basically html links manually written to go to each forum

    like what you did to link to singletrackworld, it just has a little bit of style with css

    ILL hook you up in a minute(it will be awhile) though

    @robkk

    Moderator

    okay what they did was register a menu which is a whole lot easier

    so first put this in your functions.php if you have a child theme

    function register_menu() {
    	register_nav_menu('bbmenu', __('bbpress Forum Menu'));
    }
    add_action('init', 'register_menu');
         		

    and now put this above <?php do_action( 'bbp_template_before_forums_loop' ); ?>
    which is inside loop-forums.php inside the bbpress default templates

    <nav id="subnav" role="navigation">
    
    <?php
    if ( has_nav_menu( 'bbmenu' ) ) { /* if menu location 'bbmenu' exists then use custom menu */
          wp_nav_menu( array( 'theme_location' => 'bbmenu') ); 
    }
    ?>
    
    </nav>

    now put this in your custom css or plugin

    #subnav {
    	background: none;
    	clear: both;
    	display: block;
    	float: left;
    	margin: 0 auto 6px;
    	width: 100%;
    }
    
    #subnav ul {
    	font-size: 13px;
    	list-style: none;
    	margin: 0;
    }
    
    #subnav li {
    list-style-type: none;
    display: inline-block;
    margin: 6px 4px;
    }
    
    #subnav a {
    text-decoration: none;
    color: #555;
    background: #ddd;
    padding: 2px 8px;
    border: 1px solid #e4e4e4;
    }
    
    #subnav li a:hover {
    background: #333;
    color: #fff;
    border-color: transparent;
    text-shadow: none;
    }

    tell me if you come into any problems , so i can see if i hadd a problem copy and pasting

    @robkk

    Moderator

    oh yeh create a new menu, name it , and any links to your forums with the link module in the wordpress menu system . make sure when you see theme locations click bbpress Forum Menu

    now save and your menu should show up in your forum archive

    @robkk

    Moderator

    everything on here requires you to have a child theme. especially bbpress templates in your child theme

    @dottedpixel

    Participant

    Thank you @Robkk for your easy to follow steps.

    I already had a child theme (made from woothemes canvas), in there I have a folder called “bbpress” in there I already had the “form-topic.php”, “loop-forums.php”, “user-details.php” and “user-profile.php”. And one level above is the bbpress.php file.

    I pasted the code in the functions.php of the child theme, and added the other code in the “loops-forums.php” above <?php do_action( 'bbp_template_before_forums_loop' ); ?>

    I created a new menu called bbmenu and placed a custom link into it, and I added it to the “bbpress Forum Menu location”.

    Then I pasted the css into my custom css.

    I don’t get any error every thing works fine, but there is no menu showing. mmmh?

    Could it be a problem with canvas?

    Best
    Michel

    @dottedpixel

    Participant

    In the menu settings, if I also tick the box “top menu” in theme locations (standard: bbpress Forum Menu) it does appear there.

    @robkk

    Moderator

    well maybe there is a problem with recognizing the menu location , like exactly where the function is in loop-forums.php

    first let me see a link to your website

    then im going to recreate this bbpress menu from the steps i gave you and see if i made an error copying and pasting

    by the time i finish this is what you could do

    put <nav id="subnav" role="navigation">

    <?php
    if ( has_nav_menu( 'bbmenu' ) ) { /* if menu location 'bbmenu' exists then use custom menu */
          wp_nav_menu( array( 'theme_location' => 'bbmenu') ); 
    }
    ?>
    
    </nav>

    below <?php do_action( 'bbp_template_before_forums_loop' ); ?>

    and see if that fixes anything

    @robkk

    Moderator

    Could it be a problem with canvas?

    it shouldnt be

    @dottedpixel

    Participant

    I moved the code below <?php do_action( 'bbp_template_before_forums_loop' ); ?> but it does make no difference.
    Here is the link: filmprojekt.ch/Izzy2/community/forum/

    Thanks so much for your help.

    @robkk

    Moderator

    ok i checked out all the steps ,and i literally just copied and pasted my code and it worked
    fine for me bbmenu

    i checked out the code on how to register a new menu in woothemes canvas and it looks a little different from what the code i gave you.

    you can take a look at https://support.woothemes.com/hc/en-us/articles/203106807-Add-Custom-Navigation-Menus-in-Canvas and see the how its done.

    i pretty much gave you all you need , i just cant work on the exact structure on the code it might be just adding in ‘woothemes’ but i dont know for sure

    (i work trial and error, im a 19 y/o newb haha) .

    you could wait til @robin-w or @netweb takes over , work it out yourself, or contact woothemes and link them to this topic and maybe they will help you out too.

    @dottedpixel

    Participant

    I will look at the woothemes support page and will try it. Your help was more than I was expecting to get. A big thank you.
    I am a 40 years old video designer/technician, that sometimes makes websites. HTML and CSS is no problem but php is another world for me.

    Best
    Michel

    @netweb

    Keymaster

    This is awesome, it would be great to see this as a tutorial in the codex 😉

    Codex Standards & Guidelines

    @robkk

    Moderator

    there is a little bug on this
    that i could fix in the future

    whenever i subscribe to a forum
    it shows the menu on subscribed forums in the subscriptions area in your profile
    (it showed up on the forums area in my buddypress extended profiles)

    easy fix is to turn off subscriptions to forums and topics in bbpress forum settings

    ill try to find a css way to fix this , if not ILL look up another way


    @netweb
    i might put this into the codex if i fix all the nooks and crannies

    @robkk

    Moderator

    i also forgot that buddypress uses a nav id of #subnav but thats easy to fix just change subnav to bbnav

    so all the code would be

    to register the menu

    function register_menu() {
    	register_nav_menu('bbmenu', __('bbpress Forum Menu'));
    }
    add_action('init', 'register_menu');

    place this below <?php do_action( 'bbp_template_before_forums_loop' ); ?>

    <nav id="bbnav" role="navigation">
    
    <?php
    if ( has_nav_menu( 'bbmenu' ) ) { /* if menu location 'bbmenu' exists then use custom menu */
          wp_nav_menu( array( 'theme_location' => 'bbmenu') ); 
    }
    ?>
    
    </nav>

    now add custom css

    #bbnav ul {
    	font-size: 13px;
    	list-style: none;
    	margin: 0;
    }
    
    #bbnav li {
    list-style-type: none;
    display: inline-block;
    margin: 6px 4px;
    }
    
    #bbnav a {
    text-decoration: none;
    color: #555;
    background: #ddd;
    padding: 2px 8px;
    border: 1px solid #e4e4e4;
    }
    
    #bbnav li a:hover {
    background: #333;
    color: #fff;
    border-color: transparent;
    text-shadow: none;
    }

    ok i found a css way of showing the menu only on the forum archive page

    create a page called forums that leads to the forum archive

    now make sure to grab the page id

    heres how to get the page id

    now add this css , replace (#) with the page number id for the forum archive page

    .post-# #bbnav {
    	background: none;
    	clear: both;
    	display: block;
    	float: left;
    	margin: 0 auto 6px;
    	width: 100%;
    }
    
    #bbnav {
    	display: none;  
    }
    

    now it should only show on the forum archive page only

    not in subscribed forums anymore

    if you dont see the menu , you probably need a special way to register menus for your theme

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