Support

Account

Home Forums ACF PRO ACF Location "Nav Menu" Reply To: ACF Location "Nav Menu"

  • Fantastic add-on to an already amazing plugin.

    Is there a way to retrieve the ID of a Menu Item and print it in the HTML output? I’d like to allow the Admin user to simply select a checkbox with the LABEL ‘Enable Full Width’ on menu items within the Menu Manager, which I’ve created using the field type ‘Checkbox’ with field name ‘full_width_menu_item’. So far, so good.

    Where I’m struggling is how to get the ID of menu items that have the check box enabled so that I can apply custom styling, e.g.

    <style>
    <?php [get the ID of each menu item with 'full_width_menu_item' selected]; ?> {
    background:red;
    }
    </style>

    so that the HTML output would be:

    <style>
    .menu-item-7465, .menu-item-1234 {
    background:red;
    }
    </style>

    Any help will be greatly appreciated.