Skip to content

Instantly share code, notes, and snippets.

@RalfAlbert
Last active December 14, 2015 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RalfAlbert/5091600 to your computer and use it in GitHub Desktop.
Save RalfAlbert/5091600 to your computer and use it in GitHub Desktop.
Just a testcase
<?php
/*
Template Name: Snarfer
*/
global $wp_query;
$old_query = $wp_query;
query_posts('author=1');
echo '<ul>';
while ( have_posts() ) :
the_post();
echo '<li>'.get_permalink().'</li>';
endwhile;
echo '</ul>';
wp_reset_query();
var_dump( is_page() );
var_dump( $old_query === $wp_query );
var_dump( $wp_query );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment