Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #5193

    I’d like to change size of preview image on blog page.

    For example here http://www.af-studio.pl/blog/ preview image is 610 x 260 px. I’d prefer 610 x 90

    I have found this part of code in tempalte_blog.php

    //get preview image
    $big_prev_image = kriesi_post_thumb($post->ID, array('size'=> array('L'),
    'wh' => $k_option['custom']['imgSize']['L'],

    I see imgSize=L

    I’d like imgSize=610×90 px

    What should I change?

    Thanks

    #49186

    Hey,

    in functions.php you can adjust the following line (23):

    $k_option['custom']['imgSize']['L'] = array('width'=>610, 'height'=>260); // image for blog posts

    #49187

    Thanks, it’s working :).!

    Can I prepare my own size (additional)? for example (small_preview):

    $k_option['custom']['imgSize']['small_preview'] = array('width'=>610, 'height'=>200);

    ?

    #49188

    I try to create my own, additional size with my name of size – it’s working too!

    Thanks again Chris!

    #49189

    Glad that it worked for you :)

    #49190

    Hi it’s me again.

    It worked but not exactly perfect.

    If I change a height to 160 in line 23

    $k_option['custom']['imgSize']['L'] = array('width'=>610, 'height'=>160); // image for blog posts

    everything is ok in list of posts – here is an example:

    http://www.af-studio.pl/blog/

    and in single post: http://www.af-studio.pl/illustrator/jak-narysowac-platek-sniegu-w-illustratorze/

    BUT there is new problem :) with preview image in portfolio item:

    http://www.af-studio.pl/portfolio/polska-na-rower/

    Preview image has 610 x 160 px also. :(

    I’d like to have portfolio preview image in old size.

    #49191

    Then add another image size in functions.php like:

    $k_option['custom']['imgSize']['PL'] = array('width'=>610, 'height'=>160); // image for blog posts

    and adjust the dimensions to your needs and in single.php change:

    $big_prev_image = kriesi_post_thumb($post->ID, array('size'=> array('L'),
    'wh' => $k_option['custom']['imgSize']['L'],
    'display_link' => array('lightbox'),
    'linkurl' => array ('XL','_preview_big')
    ));

    to:

    if ( get_post_type()  == 'portfolio' ){
    $big_prev_image = kriesi_post_thumb($post->ID, array('size'=> array('PL'),
    'wh' => $k_option['custom']['imgSize']['PL'],
    'display_link' => array('lightbox'),
    'linkurl' => array ('XL','_preview_big')
    ));
    }else{
    $big_prev_image = kriesi_post_thumb($post->ID, array('size'=> array('L'),
    'wh' => $k_option['custom']['imgSize']['L'],
    'display_link' => array('lightbox'),
    'linkurl' => array ('XL','_preview_big')
    ));
    }

    #49192

    Ok.

    1. In functions.php I have added new imgSize named ‘PL

    2. In single.php I have added this code (condition if else)

    3. and in portfolio preview image has still 610 x 160 which is inconsistent with condition from point 2 :)

    Here is a code after changes, maybe (probably) I did something wrong?

    http://dl.dropbox.com/u/368160/KRIESI/functions.php

    http://dl.dropbox.com/u/368160/KRIESI/single.php

    and

    http://dl.dropbox.com/u/368160/KRIESI/template_blog.php

    Thanks I really appreciate your help.

    #49193

    1) I noticed that in functions.php the dimensions for “L” and “PL” are exactly the same so you might want to change it for one size :)

    2) Try to regenerate the thumbnails with: http://wordpress.org/extend/plugins/regenerate-thumbnails/ afterwards.

    I hope this fixes the problem . if not I’ll debug single.php :)

    #49194

    I have replaced ‘PL’ with ‘L’ and ‘L’ with ‘PL’ in condition in single.php and it works fine now!

    In portfolio high preview image is 260 in blog (single post and list of posts) is 160 px :)

    Thanks Dude!

    #49195

    Glad that it works now :)

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

The topic ‘How to change preview image size in blog’ is closed to new replies.