June 30, 201115 yr Evening gents... Many times before i have set up featured images but this time it just wont play ball. It's been a long day so it may just be me being dumb however i'm setting up a new blog that uses the featured image on the home page. As usual i have this in the functions.php // This theme uses post thumbnails add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 590, 125, true ); // default post thumbnails and this within my index loop... <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail(array(590,125), array("class" => "alignleft post_thumbnail")); } ?></a> However when viewing the page the image only comes in at 125 x 125 :/ A view source brings this... <a href="http://allabouteveblog.co.uk/06/2011/blog/" title="Permalink to ‘Cherish the Dress’ Shoot in Largs" rel="bookmark"><img width="125" height="125" src="http://allabouteveblog.co.uk/wp-content/uploads/2011/06/demo2-150x150.jpg" class="alignleft post_thumbnail wp-post-image" alt="demo" title="demo" /></a> Anyone got a clue?
June 30, 201115 yr Tried giving it a handle? add_image_size('homepage-featured', 590, 125, true); along with the_post_thumbnail('homepage-featured', array("class" => "alignleft post_thumbnail")); Also, did you upload the image before changing the default thumbnail size? If so, you'll need to reupload it or install the Regenerate Thumbnails plugin. Edited June 30, 201115 yr by Renaissance-Design
June 30, 201115 yr Author CHEERS CHRIS! I've no idea why the original code worked before on the other site but not this one... and then i added the handle and it works!?!! :/
June 30, 201115 yr Don't have the faintest, but I always add as a custom size with handle when I need something specific that's not strictly a thumbnail.
June 30, 201115 yr Author That's fair enough. I've no idea either but if it works i'm not going to question it!
Create an account or sign in to comment