-
I’m trying to enable menus based on login status: (http://rocketgeek.com/tips-and-tricks/creating-menus-based-on-login-status/) and I have two menus – Main FEE (all visitors) and Client (logged in users).
However, I don’t think I’ve interpreted it correctly, as it doesn’t appear to be working. Here is what I put in header.php:
`<!– Main Navigation –>
<?php $nav_top_margin = ot_get_option(‘nav_top_margin’);
if(isset($nav_top_margin) && is_array($nav_top_margin) && !empty($nav_top_margin[0])){
$nav_extra_style = ” style=’margin-top: “.$nav_top_margin[0].$nav_top_margin[1].”;’”;
}else{
$nav_extra_style =”;
}
?><div <?php echo $nav_extra_style; ?> class=”<?php echo get_theme_mod(‘main_menu_style’); ?>”>
<?php
if( is_user_logged_in() ) {
$menu = ‘Client’;
} else {
$menu = ‘Main-FEE’;
}
wp_nav_menu( array(
‘theme_location’=> ‘main_navigation’,
‘container_id’ => ‘menu’,
‘menu_class’ => ”,
‘walker’ => new boc_Menu_Walker,
‘fallback_cb’ => ‘menuFallBack’,
‘items_wrap’ => ‘<ul>%3$s</ul>’,
));?>
</div><?php
if( is_user_logged_in() ) {
$menu = ‘Client’;
} else {
$menu = ‘Main-FEE’;
}
wp_nav_menu( array(
‘theme_location’=> ‘main_navigation’,
‘container’ => ”,
‘menu_class’ => ”,
‘walker’ => new boc_Menu_Select_Walker,
‘fallback_cb’ => ‘menuSelectFallBack’,
‘items_wrap’ => ‘<select id=”select_menu” onchange=”location = this.value”><option value=”">’.__(‘Select Page’, ‘Terra’).’</option>%3$s</select>’,
));?>
<!– Main Navigation::END –>`Can you help me?
I appreciate your time & assistance.
- Theme support is offered to verified customers only. To post a topic go to your Theme Category and add your question at the page bottom.
Theme Categories
Recent Topics
- TikTok & X
- Copy and Paste Problem
- Page content gets invisible when logged in as the admin
- Issue with the resizer
- Update for Parallax & Video Backgrounds for WPBakery Page Builder
- Issue with Fortuna WordPress Theme – White Screen and Editor Interface Problem
- Update to latest version of WP, PLUGINS, THEMES, PHP version
- internal server error
- Plugin included license (WPBakery) ?
- Revolution Slider Update