• I am trying to setup a new thumbnail size that should be used later by a plugin and I’ve added this trough a simple plugin as it’s explain here. This is the code I have added to it:

    add_action('init', 'add_extra_image_size');
    function add_extra_image_size()
    {
        add_image_size('add-meta-tags-size', 100, 120, true); // (cropped)
    }

    After get the plugin enabled and regenerate thumbnails by using “Regenerate thumbnails” plugin I can’t see new thumbnails generated, why? What I am missing here?

Viewing 1 replies (of 1 total)
  • Try this from the official documentation: https://codex.wordpress.org/Function_Reference/add_image_size

    add_action( 'after_setup_theme', 'baw_theme_setup' );
    function baw_theme_setup() {
      add_image_size( 'category-thumb', 300 ); // 300 pixels wide (and unlimited height)
      add_image_size( 'homepage-thumb', 220, 180, true ); // (cropped)
    }

    Notice the action hook is after_setup_theme, not init…

Viewing 1 replies (of 1 total)
  • The topic ‘How to setup new thumbnail size and regenerate thumbnails’ is closed to new replies.