How is your themes navigation setup?
With the wordpress core wp_nav_menu function or some other way?
We account for the core function http://codex.ww.wp.xz.cn/Function_Reference/wp_nav_menu
David — I am using the wp_nav_menu function.
Here’s what I have:
1) The Navigation radio buttons show on my template when I’m editing the landing page. Here is the code in my config.php of my custom template to set the Navigation option:
array(
‘label’ => “Navigation Options”,
‘description’ => “Would you like to show or hide your site’s navigation on this landing page?
Tip: Hiding navigation can increase conversion rates”,
‘id’ => ‘display-nav’,
‘type’ => ‘radio’,
‘default’ => ‘off’,
‘options’ => array(‘off’=>’Hide Navigation’,’on’=>’Show Navigation’),
‘context’ => ‘normal’
)
2) When I view the landing page, I can see that the value is being set to ‘on’ or ‘off’ appropriately. Here’s the code that I use to retrieve the value:
$display_nav = lp_get_value($post, $key, ‘display-nav’);
Here’s my question:
I’m able to use the radio buttons and see that the value changes, but I don’t see where the value is used in WordPress to tell wp_nav_menu whether or not to display the menu. Where is the code that ties my display-nav setting to wp_nav_menu?
Add the remove filter to your themes functions.php to remove our custom nav filter.
remove_filter( ‘wp_nav_menu_args’, ‘lp_wp_nav_menu_args’ );
To turn off our navigation controls and then use your metabox option to conditionally show/hide the nav element with CSS like:
Inside the index.php of your template
<?php if ($navsetting === “off”) {
echo”#nav_id{display:none !important;}”;
}
?>
Awesome! =)
If you like the plugin (or the support), we would love a quick review from you on the WordPress Plugin Repository, it would really help us out!
You can leave a review here.
Thanks and let me know if you have any questions about the plugin.