Tagged: functions.php, image sizes
-
AuthorPosts
-
August 2, 2013 at 2:58 pm #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?
August 2, 2013 at 3:31 pm #132878Hi!
Yes – see https://kriesi.at/support/topic/override-the-global-avia_config-within-child-functionsphp
Best regards,
Peter
August 2, 2013 at 5:17 pm #132879Ok 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
}
August 5, 2013 at 8:55 am #132880You 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');August 5, 2013 at 6:48 pm #132881Just updating to 1.9 so will try this tomorrow. Thanks for helping.
-
AuthorPosts
- The topic ‘Image sizes functions.php’ is closed to new replies.