Allows you to add Widgets in WordPress Navigation Menus
Screenshots
Add any widget to the 'Widgets in Menu' widget area.
Your widgets appear in an new metabox on the Edit Menus screen.
Add your widget to any menu, just like you add pages or posts.
Your widget starts appearing in the navigation menu.
Add css as per taste to finalise the look.
FAQ
The widgets show up, but the display is all messed up.
That’s because the css for the nav menu was never meant to take care of widgets.
For example, if the widget contains a link, you might have to redo it. If it’s a calendar:
.yawp_wim_wrap a {
width: auto !important;
padding: 0 !important;
}
How does one style the widgets?
Inspect element is your friend. Otherwise, the menu item will have the classes menu-item-type-yawp_wim, menu-item-object-yawp_wim.
Additionally, the widget will be wrapped in a div with the class yawp_wim_wrap.
Using these selectors, one can style the widgets.
Also, using various filters (see: Other Notes), especially yawp_wim_attribute_prefix, you can change this yawp_wim prefix to something of your own:
add_filter('yawp_wim_attribute_prefix','my_prefix');
function my_prefix($default_prefix){
return 'my_prefix';
}
The wrapper class will now be my_prefix_wrap and so on.
How does one use the plugin?
View the screenshots for usage instructions.
Installation Instructions
- Install the plugin from the ‘Plugins’ section in your dashboard (Go to Plugins > Add New > Search and search for Widgets in Menu for WordPress).
- Alternatively, you can download the plugin from the repository. Unzip it and upload it to the plugins folder of your WordPress installation (wp-content/plugins/ directory of your WordPress installation).
- Activate it through the ‘Plugins’ section.
ChangeLog
1.0.0
- Fixed i18n issues.
- Added Composer support
- Fix issues with empty widget titles thanks to Niklas Rosenqvist
0.2.1
- Fixed notice.
- Moved attribute prefix to main file.
0.2.0
- Refactored code completely in line with WP standards.
- Fixed notices by overriding WP’s default add menu item function.
0.1.0
- Added translation support.
- Added label for single menu item.
- Added Widget type + Set title just like widget areas.
- Improved js.
- Added minified js.
- Better filter for html element attribute.
- Better inline documentation.
- Improved readme and help.
- Added screenshots.
0.0.1