• Hi, I’ve just installed Starkers by Viewport Industries, and want to show a 300×300 featured image with every post. I added thumbnail support to the theme, and then specified the dimensions in functions.php like this:

    add_theme_support('post-thumbnails');
    	set_post_thumbnail_size( 300, 300 );

    I then added
    <?php the_post_thumbnail(); ?>
    into the index.php

    The image does display on the front page (www.blog.advancetogo.com), but not at those dimensions. When I look at the inspector, I see the following:

    img[Attributes Style] {
    width: 300px;
    height: 77px;
    }

    Any advice?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ibilic

    (@ibilic)

    It appears to take on the horizontal measurement I give it, but not the height, which is reduced to 77.

    is good ! but i think is good!look:

    `
    .attachment-post-thumbnail{
    float:left;
    margin-top:5px;
    margin-right:10px;
    }
    img.attachment-post-thumbnail {
    width:240px;
    height:auto;
    border:10px solid #fefefe;
    }`

    If u’re using the chrome inspector [Attributes Style] usually means that the CSS is inline, inside the tag

    Hi there. You have probably resolved this issue @ibilic. However, for anyone else having this problem, like I did, here’s one solution:

    1. In functions.php, set a thumbnail size. You can do this during theme setup, viz:
      function my_theme_setup(){add_theme_support('post_thumbnails');
      	add_image_size('featured_preview',640,480,TRUE);}
      add_action('after_setup_theme','my_theme_setup');

      This will make your featured preview thumbnail size available to your theme.

    2. Within your theme templates, you can then retrieve a post thumbnail sized accordingly, by using:
      <?php echo the_post_thumbnail('featured-preview'); ?>

    Hope this helps someone. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Attributes Style] overwriting set_post_thumbnail_size on featured images’ is closed to new replies.