I am trying to make a custom web app with wordpress. I have a page, Person with URL http://www.domainname.com/person. In that page, i have a shortcode. This shortcode is going to extract a get parameter from the URL such as http://www.domainname.com/person?id=5. The problem is that when clicking on URL like http://www.domainname.com/person?id=5, wordpress is complaining that the page does exist when the page http://www.domainname.com/person exist. How can I solve this ?

  • Your permalinks don't have a trailing slash? Is the parameter you're using actually id? Note that WordPress has a lot of query vars that when appended to the URL will change the main query and cause 404s. – Milo Oct 26 '15 at 21:22
  • You are right, I was using a get Parameter name which was causing this problem, thanks :) – Noor Oct 26 '15 at 21:43

id is already used by WordPress, it's a query variable and a reserved name. If you put ?id=5 on the end of a URL, you're asking for the post with ID 5.

Instead, have you considered using a person post type? This would give you an archive, add/edit screen, admin listings, templates, individual person templates, URL paths, etc all for free No need to create a page and a page template, just use single-person.php and archive-person.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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