Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Wait! Although that method is certainly ditchable (and probably should be reported), get_posts() still works, and

    <?php
     $lastposts = get_posts('numberposts=3');
     foreach($lastposts as $post) :
        setup_postdata($post);
     ?>
    		<?php the_post_thumbnail(); ?>
     <?php the_content(); ?>
     <?php endforeach; ?>

    works perfectly.

    Not a perfect solution, but works for my project…

    – n.

    The same thing is happening to me with the most recent WP version … looks like a bug.

    nlaffan

    (@nlaffan)

    Better still, just toss this in your parent template.

    Only the thumbnails of your child pages show up, so long as you create a custom field entitled image-thumb in that (child) page with the image path it should work
    .cheers.

    <div class="maincontent">
                   <?php the_ID(); ?>
                   <?php $parent = $post->ID; ?>
    <?php
    query_posts('posts_per_page=5&post_type=page&post_parent='.$parent);
     while (have_posts()) : the_post();
    ?>
    
        <?php $image_thumb = get_post_meta($post->ID, 'image-thumb', true); ?>
    	<img src="<?php echo $image_thumb; ?>" alt="Image" />
    
    <?php endwhile; ?>
    </div>
Viewing 3 replies - 1 through 3 (of 3 total)