I have a CPT of Hotels in my WordPress Website, and I have a specific footer for this CPT (i.e. applies to all hotels), which contains a contact form.
Currently, when a user send me an email I don’t know from which hotel this email came from.
How could I interactively add some dynamic text to the message that I could identify the hotel (for example, showing me the page title, or the page link in which the form was sent).
2
Answers
Follow these steps:
Add this js code to your global javascript:
Is the form hard-coded? You could use a hidden field within the form with
value="<?php the_permalink(); ?>"
or<?php the_title(); ?>