Thumbnails (category)

add_image_size()

Registers a new image size (thumbnail).

delete_post_thumbnail()

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

get_intermediate_image_sizes()

Gets an array of the names of all intermediate image sizes registered for the site. You can also get all size data.

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_image_size()

Checks whether the specified image size exists.

has_post_thumbnail()

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

image_get_intermediate_size()

Gets an array of image-attachment data of the specified size: thumbnail, medium etc., if it exists.

remove_image_size()

Removes a previously registered image size by it name. The new image size is registered with add_image_size().

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.

wp_get_additional_image_sizes()

Gets data of all additionally registered image sizes (thumbnails).

wp_get_attachment_thumb_url()

Retrieves the URL of the attachment image with size thumbnail.

wp_get_image_editor()

Returns a WP_Image_Editor object with the specified image. Used for resizing an image (creating thumbnails) and editing the image.

wp_get_registered_image_subsizes()

Gets the data (width, height, crop) of the currently registered image sizes.