Using WP_Query to get attachments
-
Is there a way to get attachments with WP_Query?
It seems to work only with get_posts():
$attachments = new WP_Query('post_type=attachment'); // not working $attachments = query_posts('post_type=attachment'); // not working $attachments = get_posts('post_type=attachment'); // works var_dump($attachments);
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Using WP_Query to get attachments’ is closed to new replies.