How to extract images of post and pages excluding header and logo image in wordpress?
I believe this will get you all of your attachments: $q = new WP_Query( array( ‘post_type’=>’attachment’, ‘post_status’=>’inherit’ ) ); var_dump($q); You could further restrict that by adding other parameters, for example, ‘post_mime_type’ => ‘image’ would restrict only to images. That will return all images though, not just the ones attached to posts. What you want … Read more