Home > Backend Development > PHP Tutorial > Output thumbnail address

Output thumbnail address

巴扎黑
Release: 2016-11-22 15:00:03
Original
1237 people have browsed it

//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 ;

}


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template