If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
  • #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?




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

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


    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);



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

    Thanks again Chris!


    Glad that it worked for you :)


    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:


    and in single post: http://www.af-studio.pl/illustrator/ (Purchase code hidden if logged out) -illustratorze/

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


    Preview image has 610 x 160 px also. :(

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


    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')


    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')
    $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')



    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?





    Thanks I really appreciate your help.


    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 :)


    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!


    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.