How to chose single image for featured post on homepage? (2 posts)

  1. biffybeans
    Posted 6 years ago #

    When composing a post with multiple embedded images, how does one select one specific image to show on the homepage featured post? http://rhodiadrive.com/ is the site, and in this case, I would have liked the first image from this post http://rhodiadrive.com/2009/09/28/fpn_bill_webbie/ to show on the homepage, rather than the second.

  2. esmi
    Forum Moderator
    Posted 6 years ago #

    It depends on the theme. Something like:

    $args = array(
    	'post_type' => 'attachment',
    	'numberposts' => 1,
    	'post_status' => null,
    	'post_parent' => $post->ID
    $attachments = get_posts($args);

    should give you the first image uploaded for a given post.

Topic Closed

This topic has been closed to new replies.

About this Topic