How to add images inside WordPress 3.0 custom menu

Everyone is quite good in using WordPress 3.0 custom menus. I am going to write about a hack. with which we can put an image inside the Menu. :-)

Some basic information about menus :

  1. Theme Location : Shows where to place the menus.
  2. Instead of pages or categories we can also place a Custom Link with custom URL inside Menus.
  3. The main container area: Which has the actual Menu.

To place an image inside WordPress 3.0 menu, we will go for a Custom Menu. In the custom menu there are two options:

  1. URL :-  Link of the menu
  2. Label: – What should be the label of the Menu.

See the Image below to add an image over the Menu: -

  1. Place your URL
  2. Place your complete image path
  3. Click on the Add to menu

After doing this , you will get the following screen:

After clicking on save menu refresh the web page, the final output is like this as seen below :

  1. Image through custom menu.
  2. WordPress default pages.
  3. You can see the image code inside the code.

Now you can see, that you have an image inside a menu or we can say you have an image over the menu. The main purpose to show you this example is that we can place an image inside a WordPress custom Menu. Basically this is a hack to place an image inside the Menus, but it can come handy in some other situations also. :)

If you have any other such hack do share it with me through your comments. :)

No related posts.

  • http://wplogbook.wordpress.com Yahya

    I like this. But I’m cracking my head on current-menu-item to show the current page.

    Do you know how?

  • http://www.englishadvantage.info Walton

    Brillant. Thanks. I was messing around in css forever trying to get images to look right. This is perfect and easy.

  • http://fot.lucascorato.com lucas

    amazing!! thanks a lot!
    but i’m still struggling to insert blank lines between the links, is it possible?
    thanks again, it’s been ages I’ve been looking for this!

    • http://www.WebVai.com Jaume Garcia

      This is the way for the small lines between the links

      .menu li a {border-right: 1px solid #444;}

  • http://www.WebVai.com Jaume Garcia

    Thanks Saorabh, very interesting.

    Lucas: This is the way for the small lines between the links

    .menu li a {border-right: 1px solid #444;}

  • Thomas

    Much much appreciated…Thanks Saorabh!!

  • Pingback: How to add images and styles to the WordPress custom menu | WP Garage()

  • Varex

    same here.. I really appreciate it

  • Eliana

    I want to be able to hover over the menu image and have the image change. Is there a way to use this technique to do that?

  • Kristen

    Thanks for this workaround! It works near perfect for what I wanted to do.

  • http://www.mrpinindia.in Pranjal

    Oh! man you are just awesome, this trick works exactly as i desired!

  • http://www.ffreshword.com Pavel

    Briliant! Thanks alot. Easy and right what i needed.

  • Skalor

    This is exactly what I needed to insert a transparent gif into the menu to push some items along! Thank you.

  • Allison

    Thanks so much for publishing this – it worked perfectly for me!

  • Pingback: WEBP – Nav Bar, page, page title, permalink, | Annette B.D.()

  • http://www.vhdsystems.com Hiren Pandya

    Superb… Worked like a charm for me… Thank you… Thanks a lot…. You should develop a plugin based on this one..

    Again Thank you….
    Helped me a lot…

  • http://twitter-fail.com Twitter Fail

    This doesn’t work in WordPress 3.4.

    • http://www.iosnoops.com/ Damian Ragar

      Works on our website, running WP 3.4.1… Simple and painless!

  • http://Songbook1.wordpress.com Jim

    Attempted to use your instructions twice, placing the image code

    in the label bar of the custom links tool. What results in the menu is something titled “(Pending).” This has the correct URL, but nothing else. “Navigation Label” is blank.

  • anne

    good work

  • http://www.noamsavion.com hila peretz

    so simple and worked great on wp 3.5!!!
    thank you

  • Vineet

    Thanks! for the info. It really helped :)

  • http://www.krishnatorque.com krishnaTORQUE

    thanks man. this is really nice post.
    its easy, without any plugin, not hesitated to understand and its working well.
    +1 for you