Why this code causes infinite loop?
It was correctly pointed out what the issue is, but I also want to explain it so you have better idea of mechanics: when you use query_posts() it writes down generated WP_Query object into global $wp_query variable; have_posts() and the_post() functions are wrappers for methods of same name called using global $wp_query object; so what … Read more