Ok, there are some pretty obvious differences between the original and your code, like:
- the use of a
walker
- this is most certainly needed for the fancy styling
- the lost and empty
menu_id
parameter- depending on the according CSS this might be needed too
- the use of the
menu
parameter- ok, to switch the menu displayed we need this
- addition of of a
container_class
- could possibly influence how the menu is displayed, depends on the CSS
That said, try this:
if( is_user_logged_in() ) {
$menu = 'menu_LI';
} else {
$menu = 'sf-menu';
}
wp_nav_menu(
array(
'menu' => $menu,
'container_class' => 'menu-header',
'theme_location' => 'primary',
'menu_id' => 'sf-menu',
'walker' => new header_one_uou_nav_menu
)
);
Furthermore you might have to adjust or play around with the parameters to get this working perfectly. Take above list as starting point and you might want to read the wp_nav_menu()
again and possibly take a look at how the Walker
thing works.