I am having a problem with a local $page variable, especially when using it in The Loop. Is it a reserved variable of WordPress? Also where can I find a list of all those global variables?
2 comments
Comments are closed.
I am having a problem with a local $page variable, especially when using it in The Loop. Is it a reserved variable of WordPress? Also where can I find a list of all those global variables?
Comments are closed.
Yes. It is an “inside the Loop” global.
It is setup and used by
setup_postdata
which executes at every iteration of a standard Loop. Though meant for use inside the Loop, the variable would still be set after the Loop to the last data it was given (unless specifically unset and I don’t think it is, but am not swearing to that).The wordpress codex is definitely your friend finding such information… 🙂 and, yes,
$post
is one of wordpress’s Global Variables.