WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp get attachment thumb url

Contents

Description

Retrieve URL for an attachment thumbnail.

Usage

<?php wp_get_attachment_thumb_url$attachment_id ); ?>

Parameters

$attachment_id
(integer) (optional) Attachment ID
Default: 0

Return Values

(string|boolean) 
False on failure. Thumbnail URL on success.

Examples

<?php 
$thumb_id = 25;
$url = wp_get_attachment_thumb_url( $thumb_id );
?>
<img src="<?php echo $url ?>"/>

Notes

Change Log

Since: 2.1.0

Source File

wp_get_attachment_thumb_url() is located in wp-includes/post.php.

Related

Attachment Functions:

get_children(), get attached media(), the_attachment_link(), get_attachment_link(), wp_get_attachment_link(), wp_get_attachment_image(), wp_get_attachment_image_src(), wp_get_attachment_url(), wp_get_attachment_thumb_file(), wp_get_attachment_thumb_url(), is_attachment(), wp_get_attachment_metadata()

See also index of Function Reference and index of Template Tags.