WordPress.org

Ready to get started?Download WordPress

Forums

Post Thumbails - Squashed (5 posts)

  1. welshhuw
    Member
    Posted 3 years ago #

    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

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    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.

  3. welshhuw
    Member
    Posted 3 years ago #

    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

  4. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

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

  5. welshhuw
    Member
    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic