post_thumbnail image (tag)

delete_post_thumbnail()

Deletes the post thumbnail by post ID. The meta-field is deleted, not the thumbnail file itself.

get_post_thumbnail_id()

Gets the ID of the current (or specified) post thumbnail (featured image). Gets ID of WP attachment (image).

get_the_post_thumbnail()

Gets the IMG tag of the post thumbnail (if exists).

get_the_post_thumbnail_caption()

Gets the post thumbnail caption (description).

get_the_post_thumbnail_url()

Gets the thumbnail URL specified for the post. If there is no post thumbnail, it returns false.

has_post_thumbnail()

Checks if the specified post has a thumbnail image. Conditional tag.

set_post_thumbnail()

Sets the post thumbnail based on the provided post ID and attachment (media file) ID. If the specified attachment does not exist in the database, the function will remove the post thumbnail.

set_post_thumbnail_size()

Sets the default size of the post thumbnail.

the_post_thumbnail()

Outputs the HTML code (<img> tag) for the thumbnail of the current post.

the_post_thumbnail_caption()

Displays the post thumbnail caption.

the_post_thumbnail_url()

Outputs the URL of the current post's thumbnail. If there is no thumbnail, it returns NULL (nothing will be output). Used in the WordPress loop.