Navigation Menu IDs & Classes
This plug-in limits the classes WordPress added to navigation menus to only those desired by the Theme owner, adds a unique ID to each li and removes any empty class attributes. More about this plug-in can be found at: http://aarontgrogg.com/2011/09/28/wordpress-plug-in-navigation-menu-ids-classes/
This plug-in limits the classes WordPress added to navigation menus to only those desired by the Theme owner, adds a unique ID to each li and removes any empty class attributes.
More about this plug-in can be found at: http://aarontgrogg.com/2011/09/28/wordpress-plug-in-navigation-menu-ids-classes/
Please let me know if you have any questions/suggestions/thoughts,
Atg
- 01Download the ZIP
- 02Unzip the ZIP
- 03Copy/paste the unzipped files into your WP plug-in directory ( /wp-content/plugins/ )
- 04From within WP’s Plugin Admin panel, Activate the ‘Navigation Menu IDs & Classes’ plug-in
- 05Choose which, if any, WP classes you wish to have in your HTML
- 06Marvel at the power of technology!
Frequently asked questions.
Why bother?
WP bakes in a ton of extraneous, border-line-useless, IDs and classes on navigation menu LIs (are you really going to target id="menu-item-72" or class="page-item-58" in your CSS?). This plug-in greatly reduces those classes, and adds classes that reflect the link’s page name, in slug form, so you can easily target menu LIs in your CSS.
What WP classes are allowed to remain?
Any that you choose.
Does this work with standard and custom menus?
Yes, both standard and custom menus will get class names that reflect the page name from the link they contain, such as: About Us