WordPress.org

Support

Support » Themes and Templates » How can I display the_post_thumbnail in a get post query loop?

How can I display the_post_thumbnail in a get post query loop?

  • Hi guys,

    I’m building a custom slider for my theme, and I want to display the_post_thumbnail in my slider.. I’ve been trying to figure out how to get fetch it, but so far no luck.. This is my example code:

    <?php
    $post_id = 36;
    $queried_post = get_post($post_id);
    ?>
    <h2><?php echo $queried_post->post_title; ?></h2>
    <img src=”<?php echo $queried_post->post_thumbnail; ?>” alt=”” title=”” />
    <?php echo $queried_post->post_content; ?>
    </div>

    <div>
    <?php

    I’ve been trying to find the right statement to use, but no luck.. any help would be appreciated 🙂

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How can I display the_post_thumbnail in a get post query loop?’ is closed to new replies.
Skip to toolbar