-
AuthorPosts
-
August 6, 2013 at 10:00 am #27286
You closed the topic too click Dude :-)
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?
August 7, 2013 at 2:54 pm #133498I 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….
August 8, 2013 at 10:10 am #133499So 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);
August 8, 2013 at 10:41 am #133500Yes, 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);August 8, 2013 at 10:58 am #133501Thanks again will give it a go after lunch :-)
August 9, 2013 at 7:17 am #133502Hi!
I hope it worked out :)
Best regards,
Peter
August 9, 2013 at 7:38 am #133503Sorry 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.
August 9, 2013 at 10:44 am #133504It worked :-) Thanks for that
-
AuthorPosts
- The topic ‘Image sizes functions.php 2’ is closed to new replies.