WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. greg.siefert
    Member
    Posted 8 months 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

    http://wordpress.org/plugins/landing-pages/

  2. David Wells
    Member
    Plugin Author

    Posted 8 months 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
    Member
    Posted 8 months 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:
    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?

  4. David Wells
    Member
    Plugin Author

    Posted 8 months 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
    Member
    Posted 8 months ago #

    That worked perfectly!

  6. David Wells
    Member
    Plugin Author

    Posted 8 months 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.

Reply

You must log in to post.

About this Plugin

About this Topic