Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #791547

    Hi,
    I have found this topic in forum :
    https://kriesi.at/support/topic/enfold-image-sizes/
    the solution is ok but If we change the size in functions.php this will be overwritten at the next theme update. What do you propose to do that the modification is durable?
    Can I do this in functions.php in theme child ? If yes, how overwrite this ?

    • This topic was modified 7 years, 7 months ago by Luc.
    #791566

    if you want to create a new image size and enable to choose it via selection:

    // add new size or overwrite an existing size
    add_image_size( 'new-size', 2000, 500, true );
    
    // make the new size available in the media library (and image element etc.)
    add_filter( 'image_size_names_choose', 'my_custom_sizes' );
    
    function my_custom_sizes( $sizes ) {
        return array_merge( $sizes, array(
            'new-size' => __( 'New Size' ),
        ) );
    }
    #791568

    thanks guenni007, in child functions.php ?

    #791572

    sorry – yes
    and the “true” concerns to crop behavior
    and i think that choose is not necessary if you overwrite an existing one

    ps you can find a lot of nice functions in function-set-avia-backend.php
    and on line 546 the add_image_size function

    • This reply was modified 7 years, 7 months ago by Guenni007.
    #791581

    Thans a lot ! It works like a charm !

    #791582

    ps you can find a lot of nice functions in function-set-avia-backend.php

    Where is this file ?

    #791591

    it is in /framework/php/ but you have to be able to read and interpret it as well

    #791642

    PPS: if you have to get for your old uploaded files the new format – you might use a plugin like force regenerate thumbnails

    #791643

    yes, it is done ;) thanks a lot !

    #791654

    Hi,

    Thank you for your valuable input,@Guenni007! :)

    Luc, do you still need assistance with this topic?

    Best regards,
    Sarah

    #791655

    it’s ok for me, you can closed this topic ;)

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Created a New size image’ is closed to new replies.