WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Show Navigation — not working

[Resolved] Show Navigation — not working

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author David Wells

    @davidwells

    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.wordpress.org/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?

    Plugin Author David Wells

    @davidwells

    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;}”;
    }
    ?>

    That worked perfectly!

    Plugin Author David Wells

    @davidwells

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Show Navigation — not working’ is closed to new replies.