iterate_all_images_of_a_post.php

<?php $images = get_posts( array( 'post_type' => 'attachment', 'post_parent' => get_the_ID(), 'exclude' => get_post_thumbnail_id() // to exclude the featured image ) ); foreach($images as $image){ $img_url = wp_get_attachment_link($image->ID, '<size>', true); } ?>
Iterate all images of a post

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.