How to get Wordpress attachments to work for existing images inside the Media Library? -


I want to display images from each Wordpress post on a separate page. When using

get_children (or get_posts ), 'post_type' = & gt; 'Attachment' only works when I uploaded that image (files uploaded through 'aded media' (via WP))

If I have an existing image in one I add to the post which is already in my WP Media Library, it does not work.)

Does anyone have the 'attachment' (already uploaded) Done) to work for images?

View my test function:

  function echo_first_image ($ postID) {$ args = array ('post_type' = & gt; 'attachment', 'post_perrent' = & Gt; $ postID); $ Attachments = get ($ args); If ($ enclosure) {echo'YES '; // test answer} and {echo 'nO'; // test answer}}  

EDIT: Each 'post-type' one 'attachment' has a 'post_perrent' - does it mean that only an attachment Can i be a father


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -