0

I want to create a simple reservation (reservation.php) form for a custom content type (houses), i have created the reservation.php in the theme directory. The question is: How can i link to this general reservation form from the custom post type and pass the post id via POST or GET, so i can retrieve some information like post title, taxonomy, and so on. A plus would be do this with a nice permalink like mysite.com/lake-house/reservation/

5
  • 1
    Simply include the file in your template. Then read deeper into ajax on how to do such request in an elegant way.
    – kaiser
    May 6, 2012 at 19:07
  • Any idea how can i call this page in an elegant way like mysite.com/reservation/ istead of mysite.com/wp-content/themes/mytheme/reservation.php? May 6, 2012 at 19:55
  • This is about rewrite rules and permalinks and has got nothing to do with your question or what I wrote above.
    – kaiser
    May 6, 2012 at 21:31
  • that´s the plus of my question... check last sentence ;) May 6, 2012 at 22:09
  • 2
    Yea, but there's no plus for questions over here. Please split your questions into two, if they're not on the same topic. Thanks.
    – kaiser
    May 6, 2012 at 22:12

1 Answer 1

1

If you have to make it a separate page that's available by visiting a permalink, you have to think what happens when user visits this page directly, without visiting the single post (house) first.

If you know how to handle it, the easiest way would be to make the reservations.php it's own page template and just link to that page from within your single post, while adding post ID as an argument.

The best way to do this, however, is, like kaiser suggested, include the reservation form in the single post template.

1
  • yes, i handle the case when a user visit the page directly, the problem is that the form is too long and has it owns js libraries, thats why i consider do this in a different page ;) May 7, 2012 at 5:10

Your Answer

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

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