Lets talk about another wordpress trick.
Have you ever opened your post editor and found there is no featured image box in it?
A lot will say “yes”
The reason being that wordpress requires you to add theme support for thumbnails manually through your functions.php or some plug-in.
Adding the support manually is very simple. Open the functions.php file which lies in your active theme’s folder and paste this code.
Adding theme support for all post types.
Adding support only for pages.
Adding Thumbnail Sizes
You can add an option so that all thumbnails have an exact size and will be cropped to that size without keeping the aspect ratio of the image by setting a size and setting the third crop parameter to be true, as shown below
For using the thumbnail in theme, there are three functions.
- has_post_thumbnail() returns ‘true’ if a thumbnail has been set
- the_post_thumbnail() echos a string containing the thumbnail < img alt=”" / > tag
- get_the_post_thumbnail() returns a string containing the thumbnail < img alt=”" /> tag
Read more about thumnail on this link
Readers of this post, also read: