Support » How-To and Troubleshooting » Image post not shown in frontpage

Image post not shown in frontpage

  • First of all, i want to say Hi to community. I’m really impressed with WP functionality and so many features. Best CMS so far !!
    Ok, now problem…
    I add a picture in my post, after post there is a text. On my frontpage i see only a text. When I click on post, then I see a picture.
    So my question is, how to make a picture visible in frontpage too?
    thank you

    [mod: allow more time to get a reply]

Viewing 1 replies (of 1 total)
  • You have to make sure that you set a featured image for your posts. Once you do that, you can use the get_post_thumbnail function to call that image to your frontpage. It would end up looking like this, with your post thumbnail and title

      $thumbnails = get_posts('numberposts=5');
      foreach ($thumbnails as $thumbnail) {
        if ( has_post_thumbnail($thumbnail->ID)) {
          echo '<a href="' . get_permalink( $thumbnail->ID ) . '" title="' . esc_attr( $thumbnail->post_title ) . '">';
          echo get_the_post_thumbnail($thumbnail->ID, 'thumbnail');
          echo get_the_title();
          echo '</a>';

    You’ll have to change this to include what you need, so it’s probably worth reading up on post thumbnails.


Viewing 1 replies (of 1 total)
  • The topic ‘Image post not shown in frontpage’ is closed to new replies.