Video Tutorial Image formats


In our theme we are going to need to display the images on the front page of our articles in different places with specific dimensions. Multiple image formats can be saved using the function add_image_size ().

add_image_size ('post-thumbnail', 350, 215, true);

It is then possible to recover this format in your pages by specifying the name of the format to recover.

the_post_thumbnail ('post-thumbnail');

Be careful however with the number of formats that you define. Indeed, when uploading a WordPress media will automatically generate the defined formats which can quickly burden the sending process and the space occupied by your media.
Also, the system is not retroactive and the new formats that are added will not affect the media already sent. You can use the regenerate thumbnail extension.