Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. $args = array(
  2. 'post_type' => 'attachment',
  3. 'numberposts' => null,
  4. 'post_status' => null,
  5. 'post_parent' => $wp_query->queried_object->ID
  6. );
  7. $attachments = get_posts($args);
  8. if ($attachments) {
  9. foreach ($attachments as $attachment) {
  10. echo apply_filters('the_title', $attachment->post_title);
  11. the_attachment_link($attachment->ID, false);
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement