I have made the two menus called "logged-in" and "logged-out" in the WP admin panel.

But after the update, this doesn't work anymore. How can I change the menu when logged in in the correct way?

(PS: The theme is WPExplorer's Adapt theme.)

Note:

Actually, all I need is to change one specific button in the menu, so it is different when the user is logged in - in that case that menu button will be a "Member profile" button instead of a "Log in" button. If that can be done without changing the entire menu, that would be much better.

2 Answers
2

Actually, all I need is to change one specific button in the menu, so
it is different when the user is logged in - in that case that menu
button will be a "Member profile" button instead of a "Log in" button

Yes, you can use only one menu, assuming its slug is 'my_menu' do not add to it member profile nor login url, instead use wp_nav_menu_{$menu_slug}_items filter:

Hmm, this doesn't seem to work... The menu slug will be the manually set menu name, right? What does the first argument $items do?
–
SteevenAug 31 '13 at 5:26

It seems the problem is different. My child theme doesn't work - it simply isn't used/added to the main theme. The functions.php as well as the header.php file in the child theme don't change anything. That is of course the cause. So that must be sorted out first...
–
SteevenAug 31 '13 at 5:48

@Steeven to test child theme try to insert die('Test'); in your child theme functions.php. If the white screen with the only word 'Test' doesn't appear on site open you have a problem with the style.css file of your child theme, or the child theme is not the one activated in the backend.
–
gmazzapAug 31 '13 at 5:59

Child theme working again! And your code works perfect. Thanks alot for answer and the extra info.
–
SteevenAug 31 '13 at 6:05

Also if you want to try it with one menu like you mentioned, you could use the body classes to target those specific links.

<body <?php body_class(); ?>>

This will add classes to the body and if a user is logged in it will add a 'logged-in' class. There isn't a logged-out class so you could hide the one you want to show only to logged in users then display it when they are logged in.