[wp-hackers] query_string fail

Otto otto at ottodestruct.com
Mon Dec 5 21:49:31 UTC 2011


Most common problem for something like this: Something else screwing
around with the main query. Try calling wp_reset_query() before your
loop.

-Otto



On Mon, Dec 5, 2011 at 2:48 PM, Leo Baiano <ljunior2005 at gmail.com> wrote:
>  My question is confirmed, I:
>
> global $ query_string;
> query_posts ($ query_string);
>
> And it worked. Strange that I never needed to call the global WP trzer
> should not have the default value?
>
> 2011/12/5 Leo Baiano <ljunior2005 at gmail.com>
>
>> Guys, do not know what is happening but apparently WP is no longer
>> retrieving the value of global variable within the pages, I made the loop
>> like this:
>>
>> if (have_posts ()) {
>> while (have_posts ()) {
>> the_post ();
>> }}
>>
>> But anything that is within the IF appears on the page, the strange thing
>> is that I'm accessing a page, has no natural query_posts changing the loop,
>> it happened one hour to another, can anyone help me?
>>
>> --
>> Amplexos,
>>
>> Leo Baiano
>> http://www.leobaiano.com
>> http://www.blog.ljunior.com
>> http://www.mcelebridades.com
>> http://www.twitter.com/leobaiano
>>
>
>
>
> --
> Amplexos,
>
> Leo Baiano
> http://www.leobaiano.com
> http://www.blog.ljunior.com
> http://www.mcelebridades.com
> http://www.twitter.com/leobaiano
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list