Skip to:
Content
Pages
Categories
Search
Top
Bottom

adding links to navigation , “selected” not working

  • Avatar of Vito687
    vito687
    Participant

    @vito687

    I have added links to the navigation using a separate php file in mu-plugins using this code

    <?php

    function add_contact_to_main_menu() {

    $class = (bp_is_page(‘contact’)) ? ‘ class=”selected” ‘ : ”;

    echo ‘<li ‘ . $class. ‘>‘ . __( ‘Contact’, ‘buddypress’ ) .’‘;

    }

    add_action(‘bp_nav_items’,’add_contact_to_main_menu’);

    ?>

    this works beautifully but the only problem is that “Home” is highlighted instead of “Contact” as the selected state. Any ideas?

You must be logged in to reply to this topic.