Detect featured image among the attached images
I use the following code to extract the attached images from a post with ID: $args = array( ‘post_type’ => ‘attachment’, ‘post_parent’ => $product_id, ‘post_mime_type’ => ‘image’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘numberposts’ => -1 ); $attachments = get_posts($args); The problem is that the above code return all the attached files. Is there a … Read more