Home › Forums › Other › post_thumbnails › Re: post_thumbnails
November 19, 2010 at 7:47 pm
#74378
TheDoc
Member
Hey Al,
If you’re comfortable in editing your functions.php, then this should be a breeze. If not, let me know if I need to explain it any further.
Setting it up is as simple as:
- Open functions.php
- Add the following code:
// add post-thumbnail functionality
if (function_exists('add_theme_support')) { add_theme_support('post-thumbnails'); }
If you want, you can even alter the size output:
set_post_thumbnail_size( 100, 100, true ); // Generic settings
add_image_size( 'sidebar-ads', 125, 125, true ); // You can add custom sizes, too!
add_image_size( 'custom-size-2', 255, 236, true ); // As many as you like
To call a post_thumbnail in your loop (will use the ‘generic’ settings):
To call a custom size (will use your custom defined settings):
the_post_thumbnail('your-custom-name');