Thursday 20 June 2013

Resizing Images Perminant Change - inside your Wordpress Blog / Theme.

So you've got a theme where you'd like the images to display at a different size. You could change the image size on each individual post or you could make a change to your theme and from then on ( as long as the image you upload is bigger ) you will have that size image in your blog. There's two bits of code that are of interest
the_post_thumbnail( 'largeimage' );
This will be on your theme pages. In the case of what I'm making changes to its wp-content/themes/mytheme/category.php The function 'the_post_thumbnail' is from the Wordpress Framework and can is explained in the Function Reference here -> http://codex.wordpress.org/Function_Reference/the_post_thumbnail Here in my example the arguement 'largeimage' is being sent over to it. You will find this reffered to in the function.php of your theme ( or you can add the following line if needed )
add_image_size( 'largeimage', 420, 420 ); // Shop Page Thumbnails
This is referenced in http://codex.wordpress.org/Function_Reference/add_image_size PLEASE NOTE: this makes a new size when the image is uploaded. Meaning if you add this code after the blog is already up it will not work. http://www.padstowholidayaccommodation.co.uk

No comments: