WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields: Nav Menu Field
[resolved] Can't figure out how to get Null to display no menus (2 posts)

  1. Jason Paul
    Member
    Posted 1 year ago #

    I've got this plugin running on custom page templates and I have it so I can select different menus for the page. Some of the pages don't require any menus. Even when I don't have a menu selected it still shows a default page menu. Any idea how I can get Null to not show the menu in my page if I don't need it for that instance? Here's an example of what I'm using now.

    <?php if(get_field('menu_selector')): ?>
    <div class="sub-menu-wrapper" style="display:<?php the_field('hide_top_menu'); ?>">
    	<div class="container">
    		<div class="row">
    			<div class="col-lg-8 col-offset-2">
    				<?php the_field('menu_selector'); ?>
    			</div>
    		</div>
    	</div>
    </div>
    <?php endif; ?>

    http://wordpress.org/plugins/advanced-custom-fields-nav-menu-field/

  2. Faison
    Member
    Plugin Author

    Posted 12 months ago #

    Hi Jason,

    Sorry about that, turns out the plugin was saving the word "null" for the selected menu instead of actually allowing a null value. So my code saw that "null" was the value and would try to display the menu titled "null". Since "null" isn't the name of any of your menus, wp_nav_menu defaults to using get_pages.

    If you update to 1.1.2, that issue will be resolved.

    Thanks,
    Faison

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.