-
satyasinghParticipant
Hi,
I have the Theme Esplanade and I want to create an internal section for logged in users.Logged-in users can see the menu “intern”
Non-logged-in users can see the menu “hauptnavigation”I´ve tried to replace in the header.php this code:
<?php wp_nav_menu( array( ‘theme_location’ => ‘primary_nav’ ) ); ?>with this new code:
< ?php if (is_user_logged_in()) { ?>
< ?php wp_nav_menu( array(‘menu’ =>’intern’, ‘menu_class’ => ‘nav-menu’ )); ?>
< ?php }else { ?>
< ?php wp_nav_menu( array(‘menu’ => ‘hauptnavigation’, ‘menu_class’ => ‘nav-menu’ )); ?>
< ?php } ?>but I can´t see any navigation bar at all. It dissapeard completely and displayed the code text instead.
Can you help me please?
- This topic was modified 10 years, 5 months ago by satyasingh.
Daniel TaraKeymasterIf it displayed the code text you probably edited the files using an editor that escaped the code after saving. To make sure the changes are saved as plain text use an editor like Sublime Text.
Tagged: custom menu bar, internal section
You must be logged in to reply to this topic.