Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #25274

    Found a similar topic here and tried to apply this piece of code, but it doesn’t seem to work for me.

    I’m trying to change the size of image size for entry without sidabar…

    what am I doing wrong:

    The following was added to functions.php in the child theme:

    function avia_change_image_size_array() {

    global $avia_config;

    $avia_config = array(‘width’=>1030, ‘height’=>450 );

    }

    add_action( ‘init’, ‘avia_change_image_size_array’);

    #126351

    Hey!

    Maybe you need to regenerate the thumbnails: http://wordpress.org/extend/plugins/regenerate-thumbnails/ to see the effect?

    Best regards,

    Peter

    #126352

    I will try that.. but i don’t think its that…

    When i use layout builder and choose blog there is options there for the size of the image;

    “Select custom preview image size; Choose image size for Preview Image”

    you see when i make that change in the core functions.php i see the option for 1030×450 immediately, but when i enter it in the child functions, that option is not there.

    basically, it doesn’t use the child settings, only the core …

    #126353

    You can also try the after_setup_theme hook: http://wordpress.stackexchange.com/questions/9989/how-to-load-parent-theme-functions-php-before-child-theme

    In this case the code would look like:

    function avia_change_image_size_array() {
    global $avia_config;
    $avia_config['imgSize']['entry_without_sidebar'] = array('width'=>1030, 'height'=>450 );
    }
    add_action( 'after_setup_theme', 'avia_change_image_size_array');

    #126354

    Unfortunately, this didn’t work either.

    I guess its not a huge issue. I just need to remember to adjust the sizes with every theme upgrade.

    Thanks for trying.. :)

    #126355

    Sorry about that, I did some digging as well before but didn’t find anything either. What I typically do when I have to make changes to the core theme is make a changelog.txt file of my own that stays in the theme folder or child theme folder so that I can keep track of all my own changes by line and with code all in the same file.

    Regards,

    Devin

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

The topic ‘overwrite imgzise global settings in child theme’ is closed to new replies.