corsonr
1/5/2013 - 2:30 PM

Basic WP_Query

Basic WP_Query

<?php

// Create a new Query
$args = array( /* this were your arguments go */);
$the_query = new WP_Query( $args );

// The Loop
echo '<ul>':
while ( $the_query->have_posts() ):
	$the_query->the_post();
	echo '<li>' . get_the_title() . '</li>';
endwhile;
echo '</ul>':

// Restore original Query
wp_reset_query();

?>