WordPress.org

Plugin Directory

Menu Image

Adds a field to load the image in a menu item and displays the image inside the link in the menu before the text. Now WPML compliant.

How to wrap menu link text in `span` html element

Where you show your menu with function <?php wp_nav_menu(); ?> as param you can add array('link_before' => '<span>', 'link_after' => '</span>'). It makes css markup easier.

How to add another size for the image?

To add a new size (or remove an old one) add a function to the menu_image_default_sizes filter. For example

<?php
add_filter( 'menu_image_default_sizes', function($sizes){

  // remove the default 36x36 size
  unset($sizes['menu-36x36']);

  // add a new size
  $sizes['menu-50x50'] = array(50,50);

  // return $sizes (required)
  return $sizes;

});
?>

Requires: 3.5.1 or higher
Compatible up to: 4.0.1
Last Updated: 2014-10-28
Active Installs: 10,000+

Ratings

5 out of 5 stars

Support

1 of 14 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

2 people say it works.
0 people say it's broken.

100,2,2 100,2,2 100,2,2
100,2,2
100,2,2
100,1,1
100,2,2
100,1,1
100,1,1 100,1,1 100,1,1 100,3,3
100,1,1
100,1,1 100,1,1
100,2,2
100,4,4
100,2,2