Creating custom wordpress function not working
Im trying to add a little code to an already made thumbnail plugin.
Basically i want to get the image src of an image and the just print it into the HTML开发者_JAVA技巧, but everytime i run it, its just echoing 'Array'
This is what i have so far.
$testing = wp_get_attachment_image_src($post_thumbnail_id);
$html = '<a href="'.$testing.'">';
Any help would be greatly appreciated.
According to the Wordpress Documentation for wp_get_attachment_image_src the return value is:
An array containing: $image[0] => url $image[1] => width $image[2] => height
Therefore, this is what you need:
$html = '<a href="'.$testing[0].'">';
精彩评论