Last active
December 11, 2015 01:49
-
-
Save corygibbons/4526382 to your computer and use it in GitHub Desktop.
Function to echo a posts image urls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php function display_images_in_list($size = thumbnail) { | |
if($images = get_posts(array( | |
'post_parent' => get_the_ID(), | |
'post_type' => 'attachment', | |
'numberposts' => -1, // show all | |
'post_status' => null, | |
'post_mime_type' => 'image', | |
'orderby' => 'menu_order', | |
'order' => 'ASC', | |
))) { | |
foreach($images as $image) { | |
$attimg = wp_get_attachment_url($image->ID); | |
echo $attimg; | |
} | |
} | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment