• Hello there
    I’m having some troubles with the thumb function in my wordpress theme. I’m using the following code in my index.php file:

    <?php /* if the post has a WP 2.9+ Thumbnail */
    							if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) : ?>
    							<div class="post-thumb post-lead">
    
    								<a title="<?php printf(__('Permanent Link to %s', 'framework'), get_the_title()); ?>" href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?><?php add_theme_support( 'post-thumbnails' ); /* post thumbnail settings configured in functions.php */ ?></a>

    and this one in function.php:

    if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
    	add_theme_support( 'post-thumbnails' );
    	set_post_thumbnail_size( 570, 300, true ); // Normal post thumbnails
    	add_image_size( 'medium', 570, 300, true ); // Medium size
    	add_image_size( 'archive-thumb', 570, 300, true ); // Post thumbs
    	add_image_size( 'gallery-thumb', 570, 300, true ); // Gallery thumbs
    }

    Also I adjusted the sizes in the wordpress backend settings (I don’t konw if this is necessary, but I just wanted to make it everywhere the same). But that won’t work. The thumbs are always too small and are not cutted (they keep the dimensions). Here is the link. Maybe you could help. I see in Firebug, that somehow the image-size is indicated with 200×133 px. Thank you very much!

Viewing 6 replies - 1 through 6 (of 6 total)
  • try adding the name of the image size inside of the_post_thumbnail()

    <?php the_post_thumbnail('medium'); ?>

    like so:

    <a title="<?php printf(__('Permanent Link to %s', 'framework'), get_the_title()); ?>" href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium'); ?><?php add_theme_support( 'post-thumbnails' ); /* post thumbnail settings configured in functions.php */ ?></a>

    Thread Starter irenehofer

    (@irenehofer)

    Hi maikunari

    Thanks a lot for your advice. But there’s still something wrong. Somehow, wordpress still uses the medium sizes of 300×200 px. It is hidden somewhere…

    <img class="attachment-medium wp-post-image" width="300" height="200" title="DSC_0190" alt="DSC_0190" src="https://test.irene-hofer.ch/wp-content/uploads/DSC_01901-300x200.jpg">

    That’s what Firebug shows up…

    Have you tried re-uploading the images, I believe the function sizes the image on import, so editing the sizes in functions.php will not affect images that have already been uploaded.

    Thread Starter irenehofer

    (@irenehofer)

    Yes, I tried that. I also made some new posts with new images. But that didn’t help. But the image size is not always the same. Very strange…

    Hmmm, afraid I’m not sure what the problem could be, It might be worth running this plugin to see if it will regenerate the images to the correct sizes: Regenerate Thumbnails

    Thread Starter irenehofer

    (@irenehofer)

    Didn’t help either… I must be jinxed.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Thumbs are shown smaller than I want’ is closed to new replies.