Retrieve First Image Function
Hmm that looks familiar 😉 You are missing the orderby parameter, in this case you want to order by menu_order. Also there is no reason to query all the data using -1 when you just want one image returned so instead use 1. $attachments = get_children( array( ‘numberposts’ => 1, ‘order’=> ‘ASC’, ‘post_mime_type’ => ‘image’, … Read more