1<?php
2// The Query
3$the_query = new WP_Query( $args );
4
5// The Loop
6if ( $the_query->have_posts() ) {
7 echo '<ul>';
8 while ( $the_query->have_posts() ) {
9 $the_query->the_post();
10 echo '<li>' . get_the_title() . '</li>';
11 }
12 echo '</ul>';
13} else {
14 // no posts found
15}
16/* Restore original Post Data */
17wp_reset_postdata();