/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php //GET THE FIRST IMAGE 'order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'attachment', 'post_parent' => $post->ID, 'post_mime_type' => 'image', 'post_sta tus' => null, ); $attachments = get_posts($args); if ($attachments) { foreach ($attachments as $attachment) { echo wp_get_attachment_url($attachment->ID, 'full', false, false); } } ?>');">