• Resolved travbod579

    (@travbod579)


    Hello,

    I am integrating Word Press into an existing website and am having a problem displaying the thumbnail of the latest three posts.

    The home page of my site is a standard PHP page and one level down from the root in a folder called “Blog” is the WordPress installation.

    I am trying to elevate the latest 3 blog posts to the home page – which I can see perfectly, except I cannot get a thumbnail to appear.

    At the top of the home page I have this:

    define('WP_USE_THEMES', false);
    require('Blog/wp-blog-header.php');

    and my loop is:

    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
    
    <?php echo get_the_post_thumbnail(); ?>
    <?php the_excerpt(); ?>
    
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read More</a>

    What am I doing wrong?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey there,
    did you enable Thumnails in your functions.php?

    Moderator keesiemeijer

    (@keesiemeijer)

    So you can see the three post excerpts?

    Try it with:

    <?php echo get_the_post_thumbnail( $post->ID ); ?>

    Thread Starter travbod579

    (@travbod579)

    I have the following enabled in the Functions.php

    // This theme uses post thumbnails
    add_theme_support( 'post-thumbnails' );

    I then put this code on my top level page but had no thumbnail nor an integer relating to the post number:

    <?php $pages = get_pages(array('child_of' => 1));?> 								    <?php foreach ($pages as $page): ?>
    <?php echo $page->ID; ?>
    <?php echo get_the_post_thumbnail($page->ID); ?>
    <?php endforeach; ?>

    Is something else wrong as I can’t even get a post ID. I can get an exceprt though using:

    <?php the_excerpt(); ?>

    Cheers

    Thread Starter travbod579

    (@travbod579)

    Found the problem. I went to the post iteslf in the admin section. I didn’t realise there was a “Featured Image” section in the bottom right where I had to set the image for the thumbnail.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Post thumbnail not displaying’ is closed to new replies.