tags:

views:

28

answers:

2

I have been trying use the edit_post_link() function to contain an image. All of the quotations and parameters are driving me crazy... How can I get this to work?

This outputs Edit inside the anchor link for editing the post.

<?php edit_post_link(__("**Edit**"), ''); ?>

This outputs the image I want to use.

<?php echo "<img src=\"" ?>
<?php echo bloginfo('template_directory')?>
<?php echo "/images/edit.png\" />" ?>

I've tried tons of configurations, this is the latest, but it doesn't work.

<?php edit_post_link(__(" <img src=\" " bloginfo('template_directory') " /images/edit.png\" /> "), ''); ?>
A: 

Did you try get_edit_post_link() instead? It should return just the URL.

ShaderOp
A: 

this

<?php edit_post_link('<img src="'.get_bloginfo('template_directory').'/images/edit.png" />', '', ''); ?>

or

<?php edit_post_link(get_bloginfo('template_directory').'/images/edit.png', '<img src="', '" />'); ?>

should work

references:

get_bloginfo(), because only bloginfo() is an echo, get_bloginfo() a return value

ahmet2106