Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #27286

    You closed the topic too click Dude :-)

    https://kriesi.at/support/topic/image-sizes-functionsphp?message=update-support-forums-topic-status-error

    I have this code at the moment for my child functions.php

    <?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’=>901 ); // 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

    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

    }

    }

    add_action( ‘init’, ‘avia_change_image_size_array’);

    But you can see that the thumb nail is the wrong size:

    $avia_config = array(‘width’=>260, ‘height’=>185 );

    My child function has this

    $avia_config = array(‘width’=>260, ‘height’=>173 );

    Here is the link see image two thumb:

    http://chriswardphotography.net/galleries/fashion-and-portraits/

    Any ideas?

    #133498

    I noticed Kriesi now calls the function which registers the image sizes directly in functions.php. So we also need to call it in the child theme – use following code to change the image sizes:

    function avia_change_image_size_array()
    {
    global $avia_config;
    $avia_config['imgSize']['portfolio'] = array('width'=>495, 'height'=>200 ); // images for portfolio entries (2,3 column)
    avia_backend_add_thumbnail_size($avia_config);
    }
    add_action( 'init', 'avia_change_image_size_array', 1);

    and instead of

    $avia_config['imgSize']['portfolio'] = array('width'=>495, 'height'=>200 );	 // images for portfolio entries (2,3 column)

    insert your custom sizes….

    #133499

    So is this correct?

    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’=>901 ); // 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

    avia_backend_add_thumbnail_size($avia_config);

    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

    avia_backend_add_thumbnail_size($avia_config);

    }

    }

    add_action( ‘init’, ‘avia_change_image_size_array’, 1);

    #133500

    Yes, the code would work but I’d use

    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'=>901 ); // 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
    }
    avia_backend_add_thumbnail_size($avia_config);
    }
    add_action( 'init', 'avia_change_image_size_array', 1);

    #133501

    Thanks again will give it a go after lunch :-)

    #133502

    Hi!

    I hope it worked out :)

    Best regards,

    Peter

    #133503

    Sorry didn’t have time yesterday. Once my son is home I cant get anything done :-) I’m going to sort it now and let you know.

    #133504

    It worked :-) Thanks for that

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Image sizes functions.php 2’ is closed to new replies.