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

  1. Jason Paul
    Posted 2 years 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'); ?>
    <?php endif; ?>


  2. Faison
    Plugin Author

    Posted 2 years 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.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Custom Fields: Nav Menu Field
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.