Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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/

share|improve this question
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 '12 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? –  Tom Sarduy May 6 '12 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 '12 at 21:31
    
that´s the plus of my question... check last sentence ;) –  Tom Sarduy May 6 '12 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 '12 at 22:12

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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 ;) –  Tom Sarduy May 7 '12 at 5:10

Your Answer

 
discard

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.