Closed EmranAhmed closed 7 years ago
Use get_header_image instead of header_image. Because it doesn't return but echo.
get_header_image
header_image
You don't need to add $post->ID just use $thumbnail = wp_get_attachment_url( get_post_thumbnail_id() );
$post->ID
$thumbnail = wp_get_attachment_url( get_post_thumbnail_id() );
Use
get_header_image
instead ofheader_image
. Because it doesn't return but echo.You don't need to add
$post->ID
just use$thumbnail = wp_get_attachment_url( get_post_thumbnail_id() );