• Resolved zeaks

    (@zeaks)


    On my front page I want 300×200 size featured images. On category pages I want 630×410 images.

    I’ve added this to functions

    add_theme_support( 'post-thumbnails' );
         add_image_size( 'page-thumbnail', 630, 410, true );
         add_image_size( 'home-thumbnail', 300, 200, true );
    
    }
    add_action( 'after_setup_theme', 'mytheme_setup' );

    then in content I’m calling the thumbnail for the category template with

    <?php if ( ! post_password_required() && ! is_attachment() && ! is_single() && ! is_home() || is_category() ) :
         the_post_thumbnail('page-thumbnail');
    endif; ?>

    and using this to call the featured image for the homepage.

    <?php if ( is_home() ) :
         the_post_thumbnail('home_thumbnail');
    endif; ?>

    The featured images show, but they are scaled when viewing image info. EX: 1,024px × 768px (scaled to 296px × 222px)

    The way I understood adding the “true” to add image size is that the image if large enough, will be cropped to those exact dimensions (300×200 and 600×410), instead it doesn’t seem to be cropping them properly, but what is bothering me the most is that the large full size image is simply being resized to fit.

    Can anyone tell me what I’ve done wrong?

    Thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Trouble with add image size’ is closed to new replies.