WordPress.org

Ready to get started?Download WordPress

Forums

Thumbnail image with post. (2 posts)

  1. ddumont
    Member
    Posted 5 years ago #

    Hey Everyone,

    I have a fantasy baseball league website at
    http://www.lansdowne9.com/odfb

    I'm using WordPress as a CMS and I had a question regarding posts.

    On the right side of my website you can see three sections with links to posts based on what category they were tagged under.

    I was wondering if there is a way to post an image with the most recent post listed under each section through WP.

    The 3 images on the right are just placeholders. I would like to be able to upload an image to my post and have that image to appear on the main page under whichever category it was tagged by.

    (I already have the loop to list the 5 most recent posts in each category)

    Thanks a ton!

  2. Milo
    Member
    Posted 5 years ago #

    Either with custom fields and a key (codex) or try Justin's method.

    a base start would be:

    <?php $image = get_post_meta($post->ID, 'lead_image', true); ?>

    <img alt="<?php the_title_attribute(); ?>" src="<?php echo $image ?>" />

    placed in your loop and valued as lead_image.

Topic Closed

This topic has been closed to new replies.

About this Topic