0

how can I solve the following problem?

I have the category "Events" with the permalink www.myblog.com/events/ and of course single events like www.myblog.com/events/lets-party/. Now I want to add a custom page "Event Contacts" which should be located below "Events" like www.myblog.com/events/contact. But I can't choose category archives as a parent page in the backend.

Any advice?

1 Answer 1

1

Once wordpress reads the "Events" part of the URL it knows that what follows are posts or subcategories of the events category, and a page is neither, and that is the reason you don't even have an option of doing what you want.

Do it as a post instead of a page. Then edit you single.php to have special treatment for your contact post id if you need it. If you are lucky it might be enough to change the css for the specific post.

Alternatively you can try to use the fact that if all other URL parsing options fail, WordPress tries to parse the URL as page, and add a page with the slug "Events" and contact as its sub page. If you go that way you need to always remember not to create sub categories or posts with the slug contact.

4
  • Do it as a post instead of a page seems to be wrong, since it is clearly something different. I know that my hierarchy is a little bit illogical, but the Event Contact is only related to the event category and should be below it in some way. (Btw, the contacts are only an example. I have more pages which should be below an archive.) Can't I "override" the archive with another "page", so I can create a hierarchy?
    – Pipo
    Commented Feb 4, 2013 at 15:04
  • It is something different for you, only because you know that there are other alternatives which theoretically might be used, but for the reader of your site all the pages are the same and he will not care if you implemented it as a post or a page. The only difference between posts and pages is the ability to have an hierarchy, and since you are not going to have an hierarchy above or below the contact page they are basically the same in your case. Commented Feb 4, 2013 at 15:16
  • Sorry I didn't make this clear, but I want the option for the future to further create a hierarchy (e.g. behind the contacts page a www.myblog.com/events/contact/john-smith). Sure, in this case contact could be a subcategory, but if have other cases which would behave differently. Sorry to bother you, but I just want a "nice" hierarchy and it is cool to get different opinions :) Thank you so far.
    – Pipo
    Commented Feb 4, 2013 at 15:45
  • edited the answer Commented Feb 4, 2013 at 18:40

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.