0

I am creating a custom theme (WP version: 5.2.2). In functions.php I added a few custom image sizes in the following way:

function abhijaan_theme_setup() {
   function abhijaan_theme_setup() {
      if( function_exists( 'add_theme_support' ) ){
         ...
         add_theme_support( 'post-thumbnails' );
         ...
         if( function_exists( 'add_image_size' ) ) {
           add_image_size( 'abhijaan-blog-list-thumbnail', 100, 100, true );
           add_image_size( 'abhijaan-single-page-across', 600, 200, true );
           add_image_size( 'abhijaan-medium-thubnail', 300, 300, true );
           add_image_size( 'abhijaan-small-thumbnail', 75, 75, true );
           add_image_size( 'abhijaan-sidebar-thumbnail', 51, 51, true );
           add_image_size( 'abhijaan-postcard-thumbnail', 120, 70, true );
           add_image_size( 'abhijaan-slider', 1366, 180, true );
           add_image_size( 'abhijaan-home-banner', 1366, 500, true );
         }
       }
   }
}

add_action( 'after_setup_theme', 'abhijaan_theme_setup' );

Original images are saving fine inside wp-content/uploads/2019/08 but no thumbnail!

I am uploading all my images via Media Library for now.

What I am doing wrong?!

0

Try t0 Regenerate thumbnails by using this plugin: https://wordpress.org/plugins/regenerate-thumbnails/

| improve this answer | |
  • Regeneration is of course an option. But it would be nice if I don't use any plugin for this just because I am just creating my theme and would like to know the exact reason why the thumbnails are not saving. Can you please give me some idea on this? – Subrata Sarkar Aug 12 '19 at 14:53
  • You have to use it once, I don't think there is any other option, you don't need to do this again and again, just once after you add/edit add_image_size code, it's needed. – Den Pat Aug 13 '19 at 5:03
  • ok, I will try :) – Subrata Sarkar Aug 13 '19 at 5:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.