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/
1 Answer
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.
-
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
mysite.com/reservation/
istead ofmysite.com/wp-content/themes/mytheme/reservation.php
?