MG7282
Member
Posted 6 months ago #
I am trying to include an image in one of my menus like this, but its just printing out the path. What's the proper way to do this?
<?php $arrow = "<img src='". bloginfo('template_url') . "/images/arrow.png'/>"; ?>
<?php wp_nav_menu(array('menu' => 'main_menu', 'container' => 'ul', 'menu_id' => 'main_bar_menu',
'before' => '<div id="arrow">'.$arrow.'</div>')); ?>
Hi MG7282,
It would probably be easier to simply add an image through CSS. If you're adding this to the Navigation bar, depending on your theme, look for the unordered list inside the nav tag, something similar to this:
#access ul
<div class="menu">
Then you can add a custom image for your list items:
http://codex.wordpress.org/Styling_Lists_with_CSS#Using_a_Custom_Image_Instead_of_a_Bullet
Hope this helps!