Code to display child pages & thumbnails that worked before v. 3.1
-
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)
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.