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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.