Title: TimThumb.php
Last modified: August 19, 2016

---

# TimThumb.php

 *  [codeline](https://wordpress.org/support/users/codeline/)
 * (@codeline)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/timthumbphp/)
 * Requesting some help from anyone using timthumb.php ([http://c.hadcoleman.com/2008/06/adding-timthumb-to-your-wordpress-theme/](http://c.hadcoleman.com/2008/06/adding-timthumb-to-your-wordpress-theme/))
 * How do I output multiple thumbnails, in my case specifically, all the images 
   in a single page’s gallery?
 * I’m currently using this code to display my thumbnails generated by timthumb:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * However, it’s only displaying my last uploaded image, even though there are 10
   + images in the page’s gallery.

Viewing 1 replies (of 1 total)

 *  [chadvonlind](https://wordpress.org/support/users/chadvonlind/)
 * (@chadvonlind)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/timthumbphp/#post-1938458)
 * Try using this code within the loop.
 *     ```
       <?php
                           $args = array( 'post_type' => 'attachment', 'orderby' => 'menu_order', 'order' => 'ASC', 'post_mime_type' => 'image' ,'post_status' => null, 'post_parent' => $post->ID );
                           $attachments = get_posts($args);
                           if ($attachments) {
                               foreach ( $attachments as $attachment ) { ?>
                               <a href="<?php the_permalink() ?>"><img src="<?php bloginfo('template_url'); ?>/thumb.php?h=180&w=400&zc=1&src=<?php echo wp_get_attachment_url( $attachment->ID , false ); ?>" alt="<?php the_title(); ?>" width="400" height="180" border="0" /></a>
                           <?php	}
                               }
                           ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘TimThumb.php’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [chadvonlind](https://wordpress.org/support/users/chadvonlind/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/timthumbphp/#post-1938458)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
