Forums

the post thumbnail won't apply thumbnail sizes set in media (4 posts)

  1. Danilux
    Member
    Posted 10 months ago #

    I'm a little confused, I want to show in my homepage a gallery of 4 proyect images taken from a custome post type called portfolio, this is the code to call the images:

    <?php $args = array( 'post_type' => 'portfolio', 'posts_per_page' => 4 );?>
    				 <?php $loop = new WP_Query( $args );?>
    				 <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    				<a>/portfolio/"><?php the_post_thumbnail('thumbnail',array( 'class' => 'frame')); ?></a>
    				 <?php endwhile;	?>

    They show Ok, but I'm having trouble getting the size I set in the dashboad>settings>media
    there I changed the thumbnail size to 160 x 100 and Crop thumbnail to exact dimensions (normally thumbnails are proportional) is checked, The wierd thing is that I get 100x100 px images instead, not sure why, anyhelp is appreciated.

  2. keesiemeijer
    moderator
    Posted 10 months ago #

    You probably have set your "Post Thumbnail" dimensions in your functions.php with set_post_thumbnail_size().
    see: http://codex.wordpress.org/Post_Thumbnails
    http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size

  3. Danilux
    Member
    Posted 10 months ago #

    Nope, but inside the upload folder I see a lot of sizes thumbs when I changed the sizes before, though the loop above always displayed a 100x100 size thumb

  4. esmi
    Theme Diva & Forum Moderator
    Posted 10 months ago #

    Changing the dimensions in Settings -> Media only affects image that are uploaded after the change. If you want to resize existing images, try using the Regenerate Thumbnails plugin: http://wordpress.org/extend/plugins/regenerate-thumbnails/

Reply

You must log in to post.

About this Topic