[wp-hackers] problems with wpquery
mark at simplercomputing.net
Tue May 11 02:52:41 UTC 2010
Khaleel Abdul Karim wrote:
> * global $wp,$wp_query;
> I have tried this code to get id of a queried post/page/cat etc. But *
> $wp_query->queried_object_id* returns me a NULL value. Any solution.
> Thanks in advance.
You can dump the $wp_query array to see what's in it, look for the field
you want, and go from there. Dump it like this:
Then load a page and view the HMTL source of the page to see the dumped
output formated with line breaks (easier to read that way).
More information about the wp-hackers