WordPress at a glance

the_post_thumbnail_url() WP 1.0

Display the post thumbnail URL.

✈ 1 time = 0.002188s = very slow | 50000 times = 17.96s = slow PHP 7.0.5, WP 4.4.2

No Hooks.

Return

Nothing (null).

Usage

the_post_thumbnail_url( $size );
$size(string/array)
Image size to use. Accepts any valid image size, or an array of width and height values in pixels (in that order).
Default: 'post-thumbnail'

Code of the_post_thumbnail_url: wp-includes/post-thumbnail-template.php VER 4.9.8

<?php
function the_post_thumbnail_url( $size = 'post-thumbnail' ) {
	$url = get_the_post_thumbnail_url( null, $size );
	if ( $url ) {
		echo esc_url( $url );
	}
}

Related Functions

From tag: Thumbnail (images)

More from tag: Link (URL)

More from category: Thumbnails

No comments
    Hello, !     Log In . Register