diff --git a/README.md b/README.md index 5e6494d..b615ba8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # WordPress Menu Classes -Allow adding custom classes to WordPress menu ul, li, a and at different depths. Perfect for TailwindCSS and AlpineJS usage. +Allow adding custom classes to WordPress li, a and submenus at different depths. Perfect for TailwindCSS and AlpineJS usage. This package adds WordPress filters to allow custom arguments to wp_nav_menu to, in turn, allow custom classes to every element of a menu. You can apply a class only to certain depth of your menu as well. @@ -18,7 +18,7 @@ Install via Composer: $ composer require davidwebca/wordpress-menu-classes ``` -If your theme already uses composer, the filters will be automatically added thanks to the auto-loading and auto-instantiating class. Otherwise, if you're looking for a standalone file you want to add to your theme, either look for src/WordPressMenuClasses.php in this repository or add this [gist](https://gist.github.com/davidwebca/a7b278bbb0c0ce1d1ec5620126e863bb) in your theme's functions.php. +If your theme already uses composer, the filters will be automatically added thanks to the auto-loading and auto-instantiating class. Otherwise, if you're looking for a standalone file you want to add to your theme, either look for src/WordPressMenuClasses.php in this repository. ## Instructions @@ -26,14 +26,17 @@ The filters use the depth argument given by WordPress which is an index, thus st Here's a list of the custom arguments you can pass to wp_nav_menu that are supported by this package : -- ```link_atts``` or ```link_atts_$depth``` or ```link_atts_order_$order``` - - Add any attribute to `````` elements +- ```a_atts``` or ```a_atts_$depth``` or ```a_atts_order_$order``` - ```a_class``` or ```a_class_$depth``` or ```a_class_order_$order``` - - Add classes to `````` elements + - Add any attribute or class to `````` elements + +- ```li_atts``` or ```li_atts_$depth``` or ```li_atts_order_$order``` - ```li_class``` or ```li_class_$depth``` or ```li_class_order_$order``` - - Add classes to ```
  • ``` elements + - Add any attribute or class to ```
  • ``` elements + +- ```submenu_atts``` or ```submenu_atts_$depth``` - ```submenu_class``` or ```submenu_class_$depth``` - - Add classes to submenu ```