Image Size
The default image dimensions provided by WordPress are standard image sizes, but themes may require images of different sizes depending on the layout requirements. Therefore, the Car Dealer theme includes the following custom image sizes.
Image Size Name | Image Width | Image Height | Cropped |
---|---|---|---|
cardealer-blog-thumb | 1170 | 500 | true |
cardealer-homepage-thumb | 700 | 700 | true |
cardealer-team-thumb | 430 | 450 | true |
cardealer-testimonials-thumb | 450 | 189 | true |
cardealer-50×50 | 50 | 50 | true |
cardealer-post_nav | 124 | 74 | true |
car_thumbnail | 190 | 138 | true |
car_catalog_image | 265 | 190 | true |
car_single_slider | 876 | 535 | true |
car_tabs_image | 430 | 321 | true |
Despite this, users sometimes require a different image size as per the requirement. You must add custom image size(s) if you have any such requirements. To add your custom image size(s), you’ll need to follow below two steps:
- Step 1. Register Image Sizes
- Step 2. Regenerate Thumbnails
Register Image Sizes
To add a new image size, hook your custom function to the cardealer_image_sizes filter hook. Here below is the sample code, which you can add in the child theme’s functions.php
.
function cardealer_child_image_sizes( $image_sizes ) { // Add your image sizes. $image_sizes['cardealer_custom_200'] = array( 'name' => 'cardealer_custom_200', 'width' => 200, 'height' => 200, 'crop' => true, 'size_name' => esc_html__( 'CarDealer Custom 200', 'cardealer-child' ), ); return $image_sizes; } add_filter( 'cardealer_image_sizes', 'cardealer_child_image_sizes' );
Please refer to the below documents for detailed information about the image size and names and labels of the image sizes.
- https://developer.wordpress.org/reference/functions/add_image_size/
- https://developer.wordpress.org/reference/hooks/image_size_names_choose/
Regenerate Thumbnails
If you add new image sizes to your existing site, you must regenerate the thumbnails. This is necessary because WordPress will only resize images that have been uploaded after registering the new image size.
Therefore any image (added/uploaded before registration of the new image size) will not have any new size. So you need to regenerate the new image size for the old images.
To regenerate the image, you can use the below plugins. For details about settings and usage, please refer to the instructions provided on the plugins page.
The newly added image size and size names will appear in different sections of the site.


Important Note: If you want to manage/control the above image sizes, you can hook your custom function to the cardealer_image_sizes filter hook, by which you can either change the image size dimension/parameters or add/delete any predefined image size. While deleting any predefined image size, ensure that these defined image sizes are used in various sections on the site.