concept-image / wp-base-nav
A package to add a simple component to call wp_nav_menu as a component with options.
Requires
- php: >=8.2
- roots/acorn: >=4.3
README
WP Base Nav is a Composer package that provides a simple component to call wp_nav_menu as a component with options.
Installation
You can install the package via Composer:
composer require concept-image/wp-base-nav
Then install the base nav with wp :
wp acorn vendor:publish --tag="wp-base-nav"
Usage
To use the WP Base Nav component, you can call it in your theme files like this:
<x-nav.base-nav
theme_location="main-nav"
container_class="py-2"
depth="2"
/>
And then you can style the nav element with @apply of Tailwind CSS.
If you need more advanced manipulation on your nav, you can create your own component that extends the BaseNav component.
Contributing
Contributions are welcome! Please submit a pull request or open an issue to discuss what you would like to change.
License
This package is open-sourced software licensed under the MIT license. Please see License File for more information.