Title: Post thumbnails
Last modified: August 19, 2016

---

# Post thumbnails

 *  [srpd](https://wordpress.org/support/users/srpd/)
 * (@srpd)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/post-thumbnails-1/)
 * Hi i’m using 2.9.x version of wordpress and the new thumbnail funcion.
 * To use it i set my function.php in this way :
 *     ```
       <?php
       if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
       	add_theme_support( 'post-thumbnails' );
       	set_post_thumbnail_size( 270, 100, true ); // Normal post thumbnails
       	add_image_size( 'single-post-thumbnail', 500, 300, true ); // Permalink thumbnail size
       add_image_size( 'related-post-thumbnail', 100, 100, true ); // Permalink thumbnail size
       }
   
       php?>
       ```
   
 * my question: i need another thumbnail of different dimension to insert it in
 *     ```
       <? $quantipost = '10'; // totale dei post da mostrare ?>
       <h2> <?=$quantipost; ?> Post a caso</h2>
           <ul>
             <?php
        $rand_posts = get_posts('numberposts=$quantipost&orderby=rand');
        foreach( $rand_posts as $post ) :
        ?>
             <li><a href="<?php the_permalink(); ?>">
               <?php the_title(); ?>
               </a></li>
             <?php endforeach; ?>
           </ul>
       ```
   
 * is it possible?
 * when i put <?php the_post_thumbnail( ‘related-post-thumbnail’ ); ?> in that funcion
   the pic that is showed is always the same, how can i solve this?
    thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [srpd](https://wordpress.org/support/users/srpd/)
 * (@srpd)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/post-thumbnails-1/#post-1333669)
 * this is the function that i’m trying to use :
 *     ```
       <div id="related_post">
       <h4>Questo articolo ti &egrave piaciuto, allora leggi anche:</h4>
           <ul>
             <?php
        $rand_posts = get_posts('numberposts=5&orderby=rand');
        foreach( $rand_posts as $post ) :
        ?>
             <li><a href="<?php the_permalink(); ?>">
               <?php the_title(); ?><?php the_post_thumbnail( 'related-post-thumbnail' ); ?>
               </a></li>
             <?php endforeach; ?>
           </ul>
       </div>
       ```
   
 *  Thread Starter [srpd](https://wordpress.org/support/users/srpd/)
 * (@srpd)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/post-thumbnails-1/#post-1333911)
 * anyone can give me a hint or suggestion? 🙂
 *  [Brandon Dove](https://wordpress.org/support/users/brandondove/)
 * (@brandondove)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/post-thumbnails-1/#post-1334087)
 * [Your answer can be found here](http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Post thumbnails’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Brandon Dove](https://wordpress.org/support/users/brandondove/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/post-thumbnails-1/#post-1334087)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
