mattrabe / Widgets-In-Menu-for-WordPress

Allows you to add Widgets in WordPress Navigation Menus
1 stars 0 forks source link

alt text

Widgets in Menu for WordPress

Allows you to add Widgets in WordPress Navigation Menus

Description

Allows you to add Widgets in WordPress Navigation Menus via a custom widget area and an extra box in menu edit screen.

Warning

You will need to have some CSS skills for the widgets to display properly in nav menus.

Usage

View the screenshots for usage instructions.

Source code and Contributions

Fork on Github

Contributions are always welcome

Documentation

Installation

Frequently Asked Questions

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.

Screenshots

  1. Add any widget to the 'Widgets in Menu' widget area.
  2. Your widgets appear in an new metabox on the Edit Menus screen.
  3. Add your widget to any menu, just like you add pages or posts.
  4. Your widget starts appearing in the navigation menu.
  5. Add css as per taste to finalise the look.

Changelog

0.2.1

0.2.0

0.1.0

0.0.1

Hooks

Actions

yawp_wim_pre_callback

Fires before a widget's display callback is called. Similar to 'dynamic_sidebar' action.

Parameters

Filters

yawp_wim_attribute_prefix

Filters the prefix used in class/id attributes in html display.

Parameters

yawp_wim_widget_params

Filter the parameters passed to the widget's display callback. Similar to 'dynamic_sidebar_params' filter

Parameters

yawp_wim_no_widgets_message

Filters the html displayed if no widgets are present in the sidebar.

Parameters