2020-05-02 / 4856阅 / 悠然
Retrieve the post thumbnail.
When a theme adds ‘post-thumbnail’ support, a special ‘post-thumbnail’ image size is registered, which differs from the ‘thumbnail’ image size managed via the Settings > Media screen.
When using the_post_thumbnail() or related functions, the ‘post-thumbnail’ image size is used by default, though a different size can be specified instead as needed.
(int|WP_Post)
(Optional)
Post ID or WP_Post object. Default is global $post.
Default value: null
(string|array)
(Optional)
Image size to use. Accepts any valid image size, or an array of width and height values in pixels (in that order).
Default value: 'post-thumbnail'
(string|array)
(Optional)
Query string or array of attributes.
Default value: ''
(string) The post thumbnail image tag.