Support » Fixing WordPress » How to chose single image for featured post on homepage?

Viewing 1 replies (of 1 total)
  • esmi

    (@esmi)

    Forum Moderator

    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.

Viewing 1 replies (of 1 total)
  • The topic ‘How to chose single image for featured post on homepage?’ is closed to new replies.