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
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 View my test function: EDIT: Each 'post-type' one 'attachment' has a 'post_perrent' - does it mean that only an attachment Can i be a father get_children
(or get_posts
), 'post_type' = & gt; 'Attachment' only works when I uploaded that image (files uploaded through 'aded media' (via WP))
'attachment'
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}}
Comments
Post a Comment