By: Prem Tiwari | Last Updated:
Sometime during customizing the WordPress themes or create new templates inside the active theme folder, we need to display the complete path of the featured image from your page or post. This is a very short tutorial, which will let you know how to get the featured image src path.
Use the below code in your theme or template files where you need to print the complete image src path of the featured image.
There are a pre-defined function
wp_get_attachment_image_src() to get featured image src path.
$imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full");
Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies. View all posts by Prem Tiwari
Tags: wordpress tutorial, wordpress tutorial for beginner, wordpress tutorial for beginners, wp get attachment image path, wp get attachment image src, wp_get_attachment_image_src full size, wp_get_attachment_image_src path