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>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.