how to write code for this requirement and i want to show menus only in header menu with different menus to logged users


Create defferent menus in admin panel. Go to header.php and create condition, where you need change menus. Search wp_nav_menu() function and wrap into like this condition:

    // call menu for logged users 
   // for non logged users

Not the answer you're looking for? Browse other questions tagged or ask your own question.