i have a Wordpress site that has the main page set to a specific template.

www.mydomain.com -> main_page_template

I am trying to pass in some params to my main URL as follows www.mydomain.com/?name=test&id=100

The issue is when passing in such parameters it always shows the list of current posts (it calls my index.php file which lists all posts) as opposed to the main page. When i dont pass parameters, it shows fine.

For all other pages, the above is fine (i.e. www.mydomain.com/page1/?name=test&id=100).

Any ideas on how i can pass parameters in yet still have it show the homepage?

Finally, i know the permalink settings cause some form of rewriting, how can i get the raw unrwitten query to the page, i.e. www.mydomain.com?p=100. This would help for debugging.

Thanks in advance,


1 Answer 1


Do not use the terms name and id. Because they are used by WP itself hence leading to a conflict. Use something specific like ch_id and ch_name, and you'll have them in the $_GET array. Try it, I'm sure it will work!

  • YES! It works thank you, seems i was using registered names even when i tried it with other names than 'name' and 'id'... when i made them truly unique then it started working thank you. In order to 'properly' get the parameters do i need use the functions: add_filter('query_vars', 'add_my_var'); get_query_var( $var ) Apart from that, i am there! Thanks, appreciate an answer to the above and can close this question out.
    – morleyc
    Dec 20, 2011 at 21:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.