The Post Thumbnails are images that are chosen as the representative for the post.
Registering own thumbnails allows for creating additional images sizes, beyond those shipped with WordPress.
All application thumbnails should be defined inside
app\Support\thumbnails.php file. This file is included on application bootstrap by the
create method on
Thumbnail facade and pass desired image sizes in arguments.
Thumbnail::create('hero', [ 'size' => [800, 600] ]);
Create method accepts options as the second argument.
Thumbnail::create('hero', [ 'title' => ['Hero image'], 'crop' => false, ]);
crop argument changes how the images are resized. More about different cropping options you can read in Codex.
List of available options:
|Option name||Default value||Description|
||Array of titles, where the first element is a singular variant, second a plural|
||Cropping behavior for the image.|
||Array of image dimensions (width × height).|
You can get thumbnail instance with
remove method on the desired thumbnail instance to remove previously created thumbnail size.