WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Issues with distorted 'featured image' (2 posts)

  1. vikkineal
    Member
    Posted 2 years ago #

    Hi

    I'm using the following code to set the size of the 'featured image'

    //add support for thumbnails
    if ( function_exists( 'add_theme_support' ) ) {
    	add_theme_support( 'post-thumbnails' );
        set_post_thumbnail_size( 150, 150);
    }
    if ( function_exists( 'add_image_size' ) ) {
    	add_image_size( 'category-thumb', 260, 90, true); //300 pixels wide (and unlimited height)
    }

    However, when uploading an image at 520x180 or even the right dimensions are appearing distorted/pixelated.

    Looking at the image itself, it's being set as 150x150 and obviously stretching to fill the dimensions above.

    However, when displaying in the post it is showing even smaller than the sizes above.

    Any ideas?

    Thanks

  2. vikkineal
    Member
    Posted 2 years ago #

    <?php echo get_the_post_thumbnail($post->ID, 'category-thumb'); ?></a>

Topic Closed

This topic has been closed to new replies.

About this Topic