WordPress Landing Pages
[resolved] Show Navigation -- not working (6 posts)

  1. greg.siefert
    Posted 2 years ago #

    The instructions on the site (http://docs.inboundnow.com/landing-pages/dev/creating-templates/default-wp-themes) show a Show/Hide navigation option.

    However, navigation is always hidden. Is there another setting that needs to be set? How can I get this working


  2. David Wells
    Plugin Author

    Posted 2 years ago #

    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

  3. greg.siefert
    Posted 2 years ago #

    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:
    '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?

  4. David Wells
    Plugin Author

    Posted 2 years ago #

    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;}";

  5. greg.siefert
    Posted 2 years ago #

    That worked perfectly!

  6. David Wells
    Plugin Author

    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Landing Pages
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic