How to make your wordpress theme support thumbnails function?

How to make your wordpress theme support thumbnails function?
How to make your wordpress theme support thumbnails function?

One of my friend said his wordpress theme does not support thumbnails function, but the original author of the theme is no longer support this theme, and then if he changed other theme, he is afraid that that might affect the site’s ranking, my answer is as follows:

1. your theme need call the function which support wordpress thumbnail funtion:

add_theme_support (‘post-thumbnails’);

If you do not call this function, that means your theme does not support wordpress thumbnail feature, so you can add these codes by yourself in your theme’s functions.php file.

2. you can customize a variety of thumbnails

for example 300 * 300:

set_post_thumbnail_size( 300, 300, true );

Then again a 100 * 100:

set_post_thumbnail_size( 100, 100, true );

So each time you upload pictures, these two formats of thumbnails will be auto-generated.

How to call a thumbnail?

write below codes in the place you want to call thumbnails:

get_the_post_thumbnail( null, array(100,100));

Leave a Reply

Your email address will not be published.