WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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,


share|improve this question

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!

share|improve this answer
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. – Chris Dec 20 '11 at 21:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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