<?php edit_post_link('<img src="image.gif" /> Edit', '', ' | '); ?>
yeah i tried that and it doesn’t work. thanks anyways.
yes it does π I tested it, AND the usage is explained inside the codex.
http://codex.ww.wp.xz.cn/Template_Tags/edit_post_link
here’s a screenshot of the output with the source XHTML below it, I used exactly what I told you to use.
The black square is image.gif.
http://www.village-idiot.org/broke/imright.gif
hmm, ok then i’ll try again.
well where do you save the image, because the image still doesn’t appear.
it doesnt matter where you save the image if you use the full uri to the image inside the code.
Consider this, for example:
your site is at http://www.domain.com
you want to use an image that is inside /thingys/
the correct way to do that would be:
<?php edit_post_link('<img src="http://www.domain.com/thingys/image.gif" /> Edit', '', ' | '); ?>
To answer your question though, for purposes of my example, my image was, and still is, right here:
http://bigbox.village-idiot.org/image.gif
thats in keeping with how I edited the template_tag too π
Oh ok. See I was using the <?php bloginfo(‘stylesheet_directory’); ?> for the src. But is there no way to use that, i mean say you want to change the location of the theme or w/e.
well is the image going to change if you change themes? I spose it could..
this works for me:
<?php edit_post_link(' <img src="'. get_bloginfo('stylesheet_directory') .'/test.gif" /> Edit', '', ' | '); ?>
where test.gif is inside my current theme directory.
you could do this too if you dont want the image be part of the actual link.
<?php edit_post_link('Edit', '<img src="'. get_bloginfo('stylesheet_directory') .'/test.gif" /> ', ' | '); ?>
there is an intentional extra space in the above example after:
'/test.gif" />
and before:
',
so thats there is space between the image and the Edit Text.
I just wanted to say thank you to Whooami, this solved my problem as well!