gareth-gillman
9/30/2016 - 9:36 PM

Get all WP attachments

<ul>
 <?php
 $query_args = new WP_Query(
  array(
   'post_type' => 'attachment',
   'posts_per_page' => -1,
  )
 );
 if ( $query_args->have_posts() ) {
  while ( $query_args->have_posts() ) : $query_args->the_post();
   $query_args->the_post();
   echo '<li>' . get_the_title() . '</li>';
  endhwile;
 }
 ?>
</uk>