WordPress.org

Ready to get started?Download WordPress

Forums

Frisco for BuddyPress
Custom menu (3 posts)

  1. zarex
    Member
    Posted 2 years ago #

    Hi

    I have 2 problems.
    Im using the frisco theme.

    Problem nr1 i want 2 different menus. one for user that are logged in, and 1 one for users who is logged out.

    And the other problem is, how do i create a menu button that takes the user to their profile site.

    Bec i'm using buddypress and if i link to members i come to the members list, and not the profile page.

    http://wordpress.org/extend/themes/frisco-for-buddypress/

  2. David Carson
    Member
    Theme Author

    Posted 2 years ago #

    Problem nr1 i want 2 different menus. one for user that are logged in, and 1 one for users who is logged out.

    If you're just trying to hide a single link for non-logged in users, a couple lines of CSS can hide it.

    #nav li.page-item-4 {
        display: none;
    }
    
    .logged-in #nav li.page-item-4 {
        display: inline-block;
    }

    You would just change the ".page-item-4" to whatever the page item number is on your site. Use Firebug or view source in browser to see.

    If you wanted to create totally different menus. One for logged-out and one for logged-in. Then open up header.php and look for the navigation menu. Add a basic conditional to check if a user is logged in and then insert the menu name you'd like to use for each situation.

    <div id="navigation" role="navigation">
    	<?php if ( is_user_logged_in() ) : ?>
    		<?php wp_nav_menu( array( 'container' => false, 'menu_id' => 'nav', 'theme_location' => 'primary', 'fallback_cb' => 'bp_dtheme_main_nav', 'menu' => 'member' ) ); ?>
    	<?php else : ?>
    		<?php wp_nav_menu( array( 'container' => false, 'menu_id' => 'nav', 'theme_location' => 'primary', 'fallback_cb' => 'bp_dtheme_main_nav', 'menu' => 'visitor' ) ); ?>
    	<?php endif; ?>
    </div>

    Note that you should insert the menu name for each menu that you create in the dashboard in the code above. For example:

    'menu' => 'visitor'

    That's how I do it on http://solopracticeuniversity.com/

  3. zarex
    Member
    Posted 2 years ago #

    Thanks for the help :)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic