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

Null. Nothing.

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'

Changelog

Since 4.4.0 Introduced.

Code of the_post_thumbnail_url() WP 5.6

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

	if ( $url ) {
		echo esc_url( $url );
	}
}

From tag: Thumbnail (images)

More from tag: Link (URL)

More from category: Thumbnails

No comments
    Log In