• Resolved hamadkhalid07

    (@hamadkhalid07)


    Hello Robin,

    Thank you for the wonderful plugin.

    Actually i am facing issue with menu order “Your profile”

    In BB Style plugin > login > show your profile in menu option i activated it but the Your Profile is showing is at the end of other menu tabs, even after logout button.

    Is there anyway we can change its position in menu ?

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Robin W

    (@robin-w)

    the code is designed to show it at the end, as that is an easy way to do it.

    If you need it elsewhere in your menu, then that is more complicated.

    do you know how to ftp and how to edit a file?

    Plugin Author Robin W

    (@robin-w)

    you could use this plugin to add a profile item to menus for logged in users

    How to Show Custom Menus to Logged In WordPress Users – WPExplorer

    Plugin Author Robin W

    (@robin-w)

    and this code in your child theme functions file to add a profile link

    add_action( 'template_redirect', 'rew_menu_profile');
    
    function rew_menu_profile(){
    	//check that profile is included 
    	if ($_SERVER['REQUEST_URI'] != '/profile/') return ;
    	//if user not logged in
    	if (!is_user_logged_in() ) {
    		return ;
    		} 
    	//user is logged in 
    	else {
    	$user_id = get_current_user_id() ;
    	$link = bbp_get_user_profile_url($user_id) ;
    	}
    	//safe redirect to esnure it is this site
    	wp_safe_redirect( $link );
    	exit;
    }
    Thread Starter hamadkhalid07

    (@hamadkhalid07)

    Hello Robin,

    Sorry, my query is different.

    i know editing of theme or plugin etc.

    i have also added “My profile” link to menu

    Now my menu list look like this

    Home – Gossips – Logout – My Profile.

    i want to show “My profile” before logout item in menu buttons.

    Home – Gossips – My Profile – Logout ( like this )

    Plugin Author Robin W

    (@robin-w)

    ok, not sure I can help further.

    Thread Starter hamadkhalid07

    (@hamadkhalid07)

    Come on robin, you can do it ??

    codejp3

    (@codejp3)

    @hamadkhalid07

    If I’m not mistaken, you should be able to do that with the plugin @robin-w mentioned: https://www.ads-software.com/plugins/user-menus/

    The order you add that “My Profile” link to the menu is the order it will be displayed.

    If you want it before “Logout”, then move it to before “Logout”

    If the “Logout” link is dynamically generated elsewhere and not actually in the menu items, then disable it wherever it’s getting generated from, and manually add a “Logout” link to your menu items and point it to:

    /login/

    Or use a plugin like “Login or Logout Menu Item” for more options with the ability to add login/logout links to the menu: https://www.ads-software.com/plugins/login-or-logout-menu-item/

    Unless I’m missing something, it really should be that easy.

    Thread Starter hamadkhalid07

    (@hamadkhalid07)

    @codejp3

    Your profile is being dynamically generated and i cannot put in manually in menu because its bbpress forum and your profile stuff require coding.

    codejp3

    (@codejp3)

    OK. I’m following you.

    What @robin-w posted should do the trick.

    1.) You’re manually creating a menu link that points to a generic “/profile/” URL. You should be able to place that anywhere in the menu you want, so that should take care of the menu order issue.

    2.) You’re using the User Menus plugin to make that specific menu item only visible to logged-in users.

    3.) You’re using the code snippet to intercept “/profile/” URLs, and redirecting them to the actual user profile page for that current logged-in user.

    If the “Your Profile” link is being dynamically generated, you need to disable that auto-generation and use steps 1-3 above.

    If you still run into issues with that, there are alternatives methods that can achieve the same thing, such as creating a shortcode that displays the “Your Profile” link and allowing shortcodes in nav menus. What @robin-w posted is an easier and more lightweight way to accomplish it though.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Menu Order of Your Profile menu’ is closed to new replies.