title: How do i add Image to Wordpress Custom Menu Widget
body: <p>I have found the code for Custom Menu Widget under /wp-includes/default-widgets.php. What I want to do is add a static image on top of the Menu UL. I already made the list vertically and I'd like to put one image on top after the widget title and before the list, but I have little knowledge with PHP.</p>
  
  <p>Here is the code for the custom menu widget:</p>
  
  <pre><code>`/**
  * Navigation Menu widget class
  *
  * @since 3.0.0
  */
  class WP_Nav_Menu_Widget extends WP_Widget {
  
  function __construct() {
  $widget_ops = array( 'description' =&gt; __('Use this widget to add one of your custom menus as a widget.') );
  parent::__construct( 'nav_menu', __('Custom Menu'), $widget_ops );
  }
  
  function widget($args, $instance) {
  // Get menu
  $nav_menu = ! empty( $instance['nav_menu'] ) ? wp_get_nav_menu_object( $instance['nav_menu'] ) : false;
  
  if ( !$nav_menu )
  return;
  
  $instance['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this-&gt;id_base );
  
  echo $args['before_widget'];
  
  if ( !empty($instance['title']) )
  echo $args['before_title'] . $instance['title'] . $args['after_title'];
  
  wp_nav_menu( array( 'fallback_cb' =&gt; '', 'menu' =&gt; $nav_menu ) );
  
  echo $args['after_widget'];
  }
  
  function update( $new_instance, $old_instance ) {
  $instance['title'] = strip_tags( stripslashes($new_instance['title']) );
  $instance['nav_menu'] = (int) $new_instance['nav_menu'];
  return $instance;
  }
  
  function form( $instance ) {
  $title = isset( $instance['title'] ) ? $instance['title'] : '';
  $nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';
  
  // Get menus
  $menus = get_terms( 'nav_menu', array( 'hide_empty' =&gt; false ) );
  
  // If no menus exists, direct the user to go and create some.
  if ( !$menus ) {
  echo '&lt;p&gt;'. sprintf( __('No menus have been created yet. Create some.'), admin_url('nav-menus.php') ) .'&lt;/p&gt;';
  return;
  }
  ?&gt;
  &lt;p&gt;
  &lt;label for="&lt;?php echo $this-&gt;get_field_id('title'); ?&gt;"&gt;&lt;?php _e('Title:') ?&gt;&lt;/label&gt;
  &lt;input type="text" class="widefat" id="&lt;?php echo $this-&gt;get_field_id('title'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('title'); ?&gt;" value="&lt;?php echo $title; ?&gt;" /&gt;
  &lt;/p&gt;
  &lt;p&gt;
  &lt;label for="&lt;?php echo $this-&gt;get_field_id('nav_menu'); ?&gt;"&gt;&lt;?php _e('Select Menu:'); ?&gt;&lt;/label&gt;
  &lt;select id="&lt;?php echo $this-&gt;get_field_id('nav_menu'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('nav_menu'); ?&gt;"&gt;
  &lt;?php
  foreach ( $menus as $menu ) {
  $selected = $nav_menu == $menu-&gt;term_id ? ' selected="selected"' : '';
  echo '&lt;option'. $selected .' value="'. $menu-&gt;term_id .'"&gt;'. $menu-&gt;name .'&lt;/option&gt;';
  }
  ?&gt;
  &lt;/select&gt;
  &lt;/p&gt;
  &lt;?php
  }
  }
  </code></pre>
  
  <p><a href="http://picpaste.com/imagehere-74PDqcOC.png" rel="nofollow">Sample Picture</a></p>