Jump to content

How to Implement a Function Into an Array Within an IMG Tag?


chaseman

Recommended Posts

I'm working on a Wordpress theme, and I'm assigning my own image to the navi list.

 

So far assigning the image to the corresponding works if I type in the path manually, but the only problem I'm experiencing is assigning the correct path to the image with a Wordpress specific function, here's the code:


<div id='nav' class='link_var_4'>	
	 <div id='blog_navi'><?php wp_nav_menu(array( "link_before" => "<li><img src='" . bloginfo ('template_directory') . "/images/arrow.png' /></li>", "theme_location" => "primary-menu")); ?>
	 </div>
</div>

 

How can I make the bloginfo function work inside the array in this above example? I've tried different variations and methods, none of them gave the expected results.

 

 

For those who don't know Wordpress, normally in Wordpress you'd do it like this:

 

<a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('description'); ?>"><img src="<?php bloginfo ('template_directory'); ?>/images/logo.png" alt="<?php bloginfo('description'); ?>" /></a>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.