Skip to content

Instantly share code, notes, and snippets.

@AbhishekGhosh
Created January 25, 2014 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AbhishekGhosh/8613721 to your computer and use it in GitHub Desktop.
Save AbhishekGhosh/8613721 to your computer and use it in GitHub Desktop.
Restore original Post Data
<?php
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
echo '<ul>';
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo '<li>' . get_the_title() . '</li>';
}
echo '</ul>';
} else {
}
wp_reset_postdata();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment