[theme-reviewers] set_post_thumbnail_size

Thomas from ThemeZee contact at themezee.com
Wed Jul 16 06:34:25 UTC 2014


Thanks for this information, Justin, I didn't know this funciton. You never
stop learning ;)

I have always created a complete new image size for the post thumbnail with
add_image_size( 'featured-image', x, x) so far. Are there any advantages to
use "post-thumbnail" instead of an own custom image size?


2014-07-16 7:51 GMT+02:00 Justin Tadlock <justin at justintadlock.com>:

> I've been seeing a trend lately where theme authors are getting
> conflicting advice from reviewers on the use of
> `set_post_thumbnail_size()`.  Some reviewers are saying not to use it.
>  Other reviewers are saying not to input any parameters.  I wanted to
> address this and make sure we're all on the same page here.
>
> First, let's look at the function itself: `set_post_thumbnail_size()`.
>  This function was created so that theme authors could have an easy method
> for creating post thumbnails that fit in with the design of their theme.
>  You can read Mark Jaquith's original tutorial on this here:
>
> http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/
>
> In order to have a thumbnail that fits in with the design of your theme,
> you actually have to set those width and height parameters.  Otherwise,
> it's pretty useless.
>
> This function was created so that theme authors could get around the
> limitations of user settings (large, medium, and thumbnail sizes), which
> the theme has no control over.  In fact, when a custom thumbnail size is
> set using this function, it creates a new image size called
> `post-thumbnail`.  This is kind of important because it's also the default
> image size used when calling functions like `the_post_thumbnail()`.
>
> This is really no different than using the `add_image_size()` function and
> naming the size `post-thumbnail`.  WP core developers just took it one step
> farther and gave us an even easier-to-use function for setting up theme
> thumbnail sizes.  Very nice of them to do that.
>
> `set_post_thumbnail_size()` exists for theme authors.  There's no reason
> we shouldn't be using it or telling theme authors that they shouldn't. I'll
> be more than happy to answer any other questions about the function or in
> this general area.
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20140716/cb2c2f7b/attachment-0001.html>


More information about the theme-reviewers mailing list