Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #27128

    You can see all image thumbnail size in the functions.php

    Is there a way of changing or over-writing them in the ‘child theme’ function.php so I don’t have to keep updating the function.php if it is changed in an theme update?

    #132878
    #132879

    Ok so I need to add this in the child function.php for all sizes (of course changing the sizes to what I want):

    <?php

    function avia_change_image_size_array() {

    global $avia_config;

    $avia_config = array(‘width’=>36, ‘height’=>36); // small preview pics eg sidebar news

    $avia_config = array(‘width’=>180, ‘height’=>180); // small image for blogs

    $avia_config = array(‘width’=>1500, ‘height’=>1001 ); // images for fullsize pages and fullsize slider

    $avia_config = array(‘width’=>1500, ‘height’=>1500 , ‘crop’ => false); // images for fullscrren slider

    $avia_config = array(‘width’=>495, ‘height’=>330 ); // images for portfolio entries (2,3 column)

    $avia_config = array(‘width’=>260, ‘height’=>173 ); // images for portfolio 4 columns

    $avia_config = array(‘width’=>710, ‘height’=>474 ); // images for portfolio entries (2,3 column)

    $avia_config = array(‘width’=>710, ‘height’=>270); // big images for blog and page entries

    $avia_config= array(‘width’=>1030, ‘height’=>687 ); // images for fullsize pages and fullsize slider

    }

    add_action( ‘init’, ‘avia_change_image_size_array’);

    What about the overwrite for the extra large layouts? How do I write this in also.

    //overwrite blog and fullwidth image on extra large layouts

    if(avia_get_option(‘responsive_layout’) == “responsive responsive_large”)

    {

    $avia_config = array(‘width’=>845, ‘height’=>564 ); // images for portfolio entries (2,3 column)

    $avia_config = array(‘width’=>845, ‘height’=>321); // big images for blog and page entries

    $avia_config= array(‘width’=>1210, ‘height’=>807 ); // images for fullsize pages and fullsize slider

    }

    #132880

    You can add the if statement to the function like

    function avia_change_image_size_array() {
    global $avia_config;
    $avia_config['imgSize']['widget'] = array('width'=>36, 'height'=>36); // small preview pics eg sidebar news
    $avia_config['imgSize']['square'] = array('width'=>180, 'height'=>180); // small image for blogs
    $avia_config['imgSize']['featured'] = array('width'=>1500, 'height'=>1001 ); // images for fullsize pages and fullsize slider
    $avia_config['imgSize']['extra_large'] = array('width'=>1500, 'height'=>1500 , 'crop' => false); // images for fullscrren slider
    $avia_config['imgSize']['portfolio'] = array('width'=>495, 'height'=>330 ); // images for portfolio entries (2,3 column)
    $avia_config['imgSize']['portfolio_small'] = array('width'=>260, 'height'=>173 ); // images for portfolio 4 columns
    $avia_config['imgSize']['gallery'] = array('width'=>710, 'height'=>474 ); // images for portfolio entries (2,3 column)
    $avia_config['imgSize']['entry_with_sidebar'] = array('width'=>710, 'height'=>270); // big images for blog and page entries
    $avia_config['imgSize']['entry_without_sidebar']= array('width'=>1030, 'height'=>687 ); // images for fullsize pages and fullsize slider

    if(avia_get_option('responsive_layout') == "responsive responsive_large")
    {
    $avia_config['imgSize']['gallery'] = array('width'=>845, 'height'=>564 ); // images for portfolio entries (2,3 column)
    $avia_config['imgSize']['entry_with_sidebar'] = array('width'=>845, 'height'=>321); // big images for blog and page entries
    $avia_config['imgSize']['entry_without_sidebar']= array('width'=>1210, 'height'=>807 ); // images for fullsize pages and fullsize slider
    }

    }
    add_action( 'init', 'avia_change_image_size_array');

    #132881

    Just updating to 1.9 so will try this tomorrow. Thanks for helping.

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

The topic ‘Image sizes functions.php’ is closed to new replies.