Skip to content

Instantly share code, notes, and snippets.

@gareth-gillman
Created September 30, 2016 21:36
Show Gist options
  • Save gareth-gillman/413ac74bf19e04cfd56f56e54a7ad28f to your computer and use it in GitHub Desktop.
Save gareth-gillman/413ac74bf19e04cfd56f56e54a7ad28f to your computer and use it in GitHub Desktop.
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment