Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1351671

    I am building a new website with a lot of photos and to save storage space I want to reduce the number of photo sizes created by Enfold.

    I don’t need these sizes:

    – 36×36 widget and other square image sizes
    – 260×185 portfolio small
    – 845×684 gallery
    – 710×375 nagazine
    – 845×321 entry with sidebar
    – 1210×423 entry without sidebar
    – 1500×430 featured
    – 1500×630 featured large

    If I understood correctly I should then add the following code to my functions.php file (in my Child theme):

    function ava_image_sizes() {
    	remove_image_size('magazine');
    	remove_image_size('widget');
    	remove_image_size('featured');
    	remove_image_size('featured_large');
    	remove_image_size('portfolio_small');
    	remove_image_size('gallery');
    	remove_image_size('entry_with_sidebar');
    	remove_image_size('entry_without_sidebar');
            remove_image_size('square');
    }
    add_action( 'after_setup_theme', 'ava_image_sizes', 11 );

    – Is that above code correct like this?
    – After adding this code I have read the advice to use the Regenerate Thumbnails plugin, but this plugin is not updated for a year, so is it still recommended?

    Thanks for your help!

    #1351762

    One other question: why is there the number 11 in the last line of the code:
    add_action( ‘after_setup_theme’, ‘ava_image_sizes’, 11 );

    #1351815

    Hi,
    Thank you for your question, your code looks correct and the Regenerate Thumbnails is still recommended, many basic plugins only need to be updated when the WordPress core changes for the specific function, which typically is seldom for this function.
    The last number is the priority that it has.

    Best regards,
    Mike

    #1351839

    Thank you Mike,

    Can I also add these lines to the code above:

    remove_image_size(‘shop_thumbnail’);
    remove_image_size(‘shop_catalog’);
    remove_image_size(‘shop_single’);
    remove_image_size(‘shop_gallery_thumbnail’);

    Thanks,
    Alwin

    #1351842

    Hi,
    You can add these:

    
    remove_image_size('shop_thumbnail');
    remove_image_size('shop_catalog');
    remove_image_size('shop_single');

    but remove_image_size(‘shop_gallery_thumbnail’); is not correct, try:

    remove_image_size('woocommerce_gallery_thumbnail');
    remove_image_size('woocommerce_single');
    remove_image_size('woocommerce_thumbnail');

    Best regards,
    Mike

    #1351852

    Thank you Mike, everything worked out fine :)

    Best Wishes,
    Alwin

    #1351854

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Remove unused Enfold image sizes’ is closed to new replies.