Support » Fixing WordPress » Post Thumbails – Squashed

  • welshhuw

    (@welshhuw)


    Hi,

    I have impletmented the built in WP thumbnails here: http://www.artclassesnowra.com/gallery/

    But as you can see some look squashed! Here is my code:

    // This theme uses post thumbnails
    	add_theme_support( 'post-thumbnails' );
    	set_post_thumbnail_size( 274, 163 );
    	add_image_size( 'artwork-thumbnail', 274, 163 );
    
    <?php
    
    				$imgfullpath = get_the_post_thumbnail($post->ID, 'full');
    				if ( preg_match('/src="([^"]*)"/', $imgfullpath, $imgfullpath) )
    					$imgfullpath = $imgfullpath[1];
    				else
    					$imgfullpath = '';
    				?>
    				<a class="thickbox fancybox" title="<?php the_title(); ?>" href="<?php echo $imgfullpath; ?>"><?php the_post_thumbnail( 'artwork-thumbnail' ); ?></a>

    Can some one help me out because I can’t get them to appear correctly. As in not being squished into the image size specified.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    Forum Moderator

    You need to amend:

    .gallery-pic img {
        border: 3px solid #45555B;
        height: 163px;
        width: 274px;
    }

    in style.css. Some of your images are smaller than 274px.

    welshhuw

    (@welshhuw)

    Thanks esmi for pointing that out to me.

    But why are the thumbnails being made to such a small size, I have declared the thumbnail size in the functions.php snippet:

    // This theme uses post thumbnails
    	add_theme_support( 'post-thumbnails' );
    	set_post_thumbnail_size( 274, 163 );
    	add_image_size( 'artwork-thumbnail', 274, 163 );

    So where am I going wrong??

    Thanks

    esmi

    (@esmi)

    Forum Moderator

    Those images aren’t using post_thumbnails. They appear to be using the standard thumbnail images as defined in Settings -> Media.

    welshhuw

    (@welshhuw)

    Ive just double checked and i havn’t changed the Media settings from the defaults?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Post Thumbails – Squashed’ is closed to new replies.