different size for featured images in post and pages
-
Hi! I would like to know how can I establish two different sizes for featured images in both posts and pages.
I put the following code on function.php and it works perfect for post images. From the single.php i called with <?php the_post_thumbnail( ‘single-post-thumbnail’ ); ?>
//Enable Post Thumnails
add_theme_support( ‘post-thumbnails’ );
//thumnail size
set_post_thumbnail_size( 121, 91 ); // 50 pixels wide by 50 pixels tall, box resize mode
//original size for the single
add_image_size( ‘single-post-thumbnail’, 500, 374 ); // Permalink thumbnail sizeBut for the pages images i would like to use a diffrent size, 162×374. For that I duplicate the code as follow and change the ‘names’, but apparently it doesn’t work like that. In addition the duplicated code disables the first one.
//Enable Post Thumnails
add_theme_support( ‘page-thumbnails’ );
//thumnail size
set_post_thumbnail_size( 121, 91 ); // 50 pixels wide by 50 pixels tall, box resize mode
//original size for the pages
add_image_size( ‘page-thumbnail’, 162, 374 ); // Permalink thumbnail sizeHopefully someone can help me.
Thanks!!
Carla
- The topic ‘different size for featured images in post and pages’ is closed to new replies.