Skip to:
Content
Pages
Categories
Search
Top
Bottom

Navigation problem -> current_page_item not set for Forums in navigation tabs


  • neosin
    Participant

    @neosin

    I’ve got bbpress as the forum for my wordpress installation on localhost.

    I’ve created a new page and inserted the bbcode to show the forum index in that page (page name is “forums”).

    In my navigation I have “Forums” and when i click it and it is the active page, it does not receive a “current_page_item” class from the navigation.

    How can I make it have the “current_page_item” class when it is selected?

    While I am using Buddypress, I do not have a page associated in buddypress with my bbpress forums because it causes the forums to not function when i do associate a page.

    In the default Buddypress template header this is the menu code:

    <div id=”navigation” role=”navigation”>

    <?php wp_nav_menu( array( ‘container’ => false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘primary’, ‘fallback_cb’ => ‘bp_dtheme_main_nav’ ) ); ?>

    </div>

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

  • neosin
    Participant

    @neosin

    here is a screenshot

    http://s15.postimage.org/8vc557n3t/Untitled_1.gif

    as you can see the forum tab does not show as being active


    Jared Atchison
    Moderator

    @jaredatch

    I see what you are saying but as far as I know bbPress doesn’t do that at the moment.

    I definitely think it would be something very handy to have. I’ll get with jjj and see if this is on the radar for a future release.


    tzeldin88
    Participant

    @tzeldin88

    Has a solution been found for this yet? When viewing any page of my Forum, my Menu (from wp_nav_menu) actually shows my NEWS tab (the LI element) (the normal “posts” post-type, for the blog section) with the “current_page_parent” class. So my forum looks as if it’s in the News section. I do have a Forum tab in my menu, but it is the Forum index page (using a shortcode). I suppose i can just use CSS to fix all this, but i would think bbPress would be able to avoid incorrectly triggering the “current_page_parent” class on the wrong element.


    rqstadman
    Participant

    @rqstadman

    Same problem here. My forum is under downloads and It’s not even my homepage


    Mitesh Patel
    Participant

    @mitesh-patel

    Same problem here as well.

    What’s more, this is a problem on testbp.org as well! Although on testbp.org the ‘discussion’ page correctly gets the current_page_parent class, it fails when you go to any forum or topic page. The ‘support’ menu item on both buddypress.org and bbpress.org remains highlighted no matter where you are in forums area.

    So my question would be, how did they set-up forums on bbpress.org and buddypress.org? I searched high and low – everywhere, but failed to find a solution. What are we doing wrong? IS it a wp_nav_menu specific problem or with bbpress?

    http://bbpress.trac.wordpress.org/ticket/2204


    Mitesh Patel
    Participant

    @mitesh-patel

    A simple solution to this issue can be achieved by css the following way.

    On each bbPress related page, bbPress plugin adds a class ‘bbPress’ to the body html element, so adding something like below would solve the problem in a non-obtrusive way.

    body.bbPress #nav > li.menu-item-318 > a { formatting for the highlighted menu item class }

    Where, menu-item-318 is the id of the page which should have been highlighted by the current_page_parent or current_menu_item class, which are not attached (for which this ticket is for).

    Of course, this is just a hack, but it does get the work done.


    robgranholm
    Participant

    @robgranholm

    @mitesh-patel Could I have some help on how to do this with my website? It’s a membership site so right now there’s nothing to see, but can you connect with me and I can give you access?

    I’m trying to adapt the code you’ve given here but this isn’t working.

    body.bbPress #nav > menu-item menu-item-type-post_type menu-item-object-page menu-item-158 sfhover > a {background: none repeat scroll 0 0 #F2F2F2;}

    The site is at http://dev.itarsenal.com right now


    robgranholm
    Participant

    @robgranholm

    Bump, any help?


    ronthai
    Participant

    @ronthai

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

You must be logged in to reply to this topic.