• Resolved dollypower

    (@dollypower)


    Hi All

    Wondering if someone could help. Basically, I’m trying to create a homepage which pulls in the thumbnail graphics from the latest blog post and various pages.

    I’ve enabled thumbnail support and have the latest blog thumbnail appearing OK. But I can’t seem to get the page thumbnails to appear. It always shows as the blog thumbnail! Not sure what I’m doing wrong.

    Here’s a demo:
    https://guiltypleasures.dollypower.com/test

    Here’s the code I’m using

    <?php $temp_query = $wp_query; ?>
        <?php query_posts('showposts=1'); ?>
        <?php while (have_posts()) : the_post(); ?>
        <?php the_post_thumbnail(); ?>
        <?php endwhile; ?>

    <?php echo get_the_post_thumbnail($page->about, 'thumbnail'); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter dollypower

    (@dollypower)

    *last bump*

    Will try to do a bit more investigating. If I figure it out, I’ll be sure to share the details on here. ??

    Thread Starter dollypower

    (@dollypower)

    Got it! Sharing it, as others may find it useful.

    For the latest blog post:

    <?php query_posts('showposts=1'); ?>
        <?php while (have_posts()) : the_post(); ?>
        <?php the_post_thumbnail(); ?>
        <?php endwhile; ?>

    For a thumbnail from a particular page (in this case id =7 ):

    <?php query_posts('page_id=7'); ?>
        <?php while (have_posts()) : the_post(); ?>
        <?php the_post_thumbnail(); ?>
        <?php endwhile; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Page thumbnails’ is closed to new replies.