Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_nav_items theme problem


  • sqrr
    Participant

    @sqrr

    Hey Folks!

    Firstly, a big thx to Jeff for the component skeleton! It’s a big help for word-/buddy-press n00bies!

    Well, i stuck now with my component on the navigation tab registration.

    The problem is when i registered the tab with “bp_nav_items” and click the tab (mydomain.com/mycomponent) the correct functions is called but it neighter loads the component css nor the member-theme. Instead it gets the home-theme.

    (It works fine like it should on the sub navigation like “mydomain.com/members/sqrr/mycomponent”)

    Did I forget to register something?

    cheers for ur help

    SQRR

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

  • Jeff Sayre
    Participant

    @jeffsayre

    SQRR-

    Firstly, a big thx to Jeff for the component skeleton!

    Your welcome! But Andy deserves the most credit. I just helped to update it.

    So, let me make sure that I understand your issue. You’ve registered your custom component using an add_action( 'bp_nav_items', ..., ...); to add a button (or tab as you’re calling it) to the navigation array. It works fine in your member’s theme but not your home theme.

    Is this correct?

    Are you using a customized home theme?

    Have you checked to make sure the header.php file in your home theme has this line?

    <?php do_action( 'bp_nav_items' ); ?>


    sqrr
    Participant

    @sqrr

    Of course! A huge thx to Andy as well! He’s any way like Santa! brings us all this lovely stuff which makes us happy ;)

    Jep, added that correctly and the button/tap is shown.

    function add_location_to_main_menu() {

    $class = (bp_is_page(\'countries\')) ? \' class=\"selected\" \' : \'\';

    echo \'<li \' . $class. \'><a href=\"\' . get_option(\'home\') . \'/countries\" title=\"\' . __( \'Countries\', \'buddypress\' ) .\'\">\' . __( \'Countries\', \'buddypress\' ) .\'</a></li>\';

    }
    add_action(\'bp_nav_items\',\'add_location_to_main_menu\');

    My Problem in this case is that it doesn’t load the structure.css from the component when I open the component over this button. It works properly when get to the page over the sub navigation link.

    (I’m using a customized home as well as a customized member theme. )

    thx 4 ur help!

    SQRR

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘bp_nav_items theme problem’ is closed to new replies.
Skip to toolbar