< meta name"/> < meta name">

Home  >  Article  >  Backend Development  >  Output thumbnail address

Output thumbnail address

巴扎黑
巴扎黑Original
2016-11-22 15:00:031211browse

//Output thumbnail address

function post_thumbnail_src() {

global $post;


if ($values ​​= get_post_custom_values("thumb")) { //Output custom domain image address

$values = get_post_custom_values("thumb");

$post_thumbnail_src = $values ​​[0];

} elseif (has_post_thumbnail()) { //If there is a featured thumbnail, output the thumbnail address

$thumbnail_src = wp _get_attachment_image_src(get_post_thumbnail_id ($post->ID), 'full');

             $post_thumbnail_src = $thumbnail_src [0];

                                                                                                                                                           ($post->ID), 'full');

echo $post_thumbnail_src ;

}


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn