I need to generate a simple error message on a page by passing a variable through the URL.
The URL is structured as follows:
http://site.com/parent-category/category/?error=pause
I’m sure it’s the permalinks rewrite interfering, but I’m not sure how to resolve it.
Try adding the variable to the WordPress’ array of ‘recognised query variables’…
Then the value of ‘my_error’ can be found via
get_query_var('my_error')
. (See Codex)EDIT
From Otto’s comment, it’s better to do:
This was the only way I could get this to work
http://codex.wordpress.org/Function_Reference/add_query_arg