Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 134540

MikeZ on "get_children for images in a single post returning an empty array"

$
0
0

Hi,

I'm trying to create a list of images in my single post page. I'm started out with the following inside the loop which I thought would have worked..

<?php $images =& get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . get_the_ID() ); ?>

<?php print_r($images)?>

This is returning an empty array. It doesn't seem to be picking up the image attachments.

Any help would be much appreciated.


Viewing all articles
Browse latest Browse all 134540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>