Configuring Nav Menus
If your WordPress theme supports Nav Menus, this plugin registers two new menu locations on your WordPress installation. You can check these menu locations under Appearance >> Menus.
- Visitors Only Menu (Membership Modules)
This menu is only visible to users who are not logged in to your website.
- Users Only Menu (Membership Modules)
This menu is only visible to logged in users.
Configuring these menus in your theme
NOTE: This is an advanced topic, if you are not sure about this, we recommend you to talk to your WordPress Theme developer to make this change or you can hire us to modify your theme.
- You need to browse your WordPress theme files to find the PHP function
wp_nav_menuthat calls the WordPress navigation menu. In most cases it should be within header.php file. If you are not sure, you can ask the Theme developer for this.
- Once you find this function you will see a PHP Array which contains the menu_location key and its value set to a location registered by the theme.
Menu ArgumentsPHP1234$args = array('theme_location' => 'menu_key_as_per_theme',);wp_nav_menu( $args );
- You need to replace ‘menu_key_as_per_theme’ with cjfm_navigation_menu(). Once you do this the second line of above should look like this. Do not change anything else in this PHP array.
Example codePHP1'theme_location' => cjfm_navigation_menu(),
- PHP function cjfm_navigation_menu() returns the nav menu location based on the user logged in status. Visitors Only Menu will be called if user is not logged in to your website and Users Only Menu will be called for logged in users.