Title: Code to display child pages &amp; thumbnails that worked before v. 3.1
Last modified: August 20, 2016

---

# Code to display child pages & thumbnails that worked before v. 3.1

 *  [jainsy](https://wordpress.org/support/users/jainsy/)
 * (@jainsy)
 * [15 years ago](https://wordpress.org/support/topic/code-that-worked-before-31/)
 * Not sure if I’m posting in the right place.. however, I came up with my own code
   to display an image, title and excerpt of child pages.
    The code worked flawlessly
   up until I upgraded from 2.8 to 3.1 now I’m having problems with displaying the
   thumbnails. They will not show at all, however, the rest of the data will. The
   following code is in one of the themes files.
 *     ```
       <?php
       $child_pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = ".$post->ID."	AND post_type = 'page' ORDER BY menu_order", 'OBJECT');	?>
       <?php if ( $child_pages ) : foreach ( $child_pages as $pageChild ) : setup_postdata( $pageChild ); ?>
       <? $pricefrom = get_post_meta($pageChild->ID, 'Quantity24', $single = true); ?>
       <? $colours = get_post_meta($pageChild->ID, 'Colours', $single = true); ?>
       <? $smalldescrip = get_post_meta($pageChild->ID, 'SmallDescrip', $single = true); ?>
       <? $OutlineImg = get_post_meta($pageChild->ID, 'OutlineImg', $single = true); ?>
       <? $ProductCode = get_post_meta($pageChild->ID, 'ProductCode', $single = true); ?>
       <a href="<?php echo  get_permalink($pageChild->ID); ?>"><?php the_post_thumbnail(array(150,150)); ?></a>
       <h2 class="gridtitle"><a href="<?php echo  get_permalink($pageChild->ID); ?>" rel="bookmark" title="<?php echo $pageChild->post_title; ?>"><? echo $ProductCode ?>  <?php echo $pageChild->post_title; ?></a></h2>
       <?php endforeach; endif; ?>
       ```
   
 * Any ideas?

Viewing 1 replies (of 1 total)

 *  Thread Starter [jainsy](https://wordpress.org/support/users/jainsy/)
 * (@jainsy)
 * [15 years ago](https://wordpress.org/support/topic/code-that-worked-before-31/#post-2126702)
 * please.. anyone?

Viewing 1 replies (of 1 total)

The topic ‘Code to display child pages & thumbnails that worked before v. 3.1’ is
closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [jainsy](https://wordpress.org/support/users/jainsy/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/code-that-worked-before-31/#post-2126702)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
