Hi,
My website is a real estate website for properties in the mountain.
I'd like to create a form to record the info request of the potential clients (CPT "demandes d'informations").
In this form Id like to display pictures related to a ski station.
The idea is to create 1 form and automatically customise it with ski station pictures. The specific ski station should be defined in the url of the form.
For example,
hidden link will display the form. Within this form there will be pictures of the CPT "Ski-station" item "Maribel".
Without creating a new form in the backend, I'd like to have hidden link, displaying the same form but with the pictures related to Chatel.
The idea is to have as many links as there are ski stations, but having a unique form retrieving picture from the CPT "ski-station"'s in order to include the links in an bulk email. Bulk email will show 4 ski stations with a "more info" button that should link to the different url's of the form.
Not sure my explanations are very clear nor if it's possible to do it "easily"...
Thanks for your help.
Best regards
Hi,
Thank you for contacting us and I'd be happy to assist.
For what you're planning, you'll need a fair amount of customization.
To achieve this custom URL structure, you'll need to use WordPress' custom URL rewrite rule feature, as explained in these guides:
hidden link
hidden link
Once you've managed to deploy this custom URL structure, you'll be able to get the target ski station's slug from the URL using the "get_query_var" function:
https://developer.wordpress.org/reference/functions/get_query_var/
From that slug, you can get that ski station's post ID and then retrieve its images from the custom field:
https://toolset.com/documentation/customizing-sites-using-php/functions/#image
I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar