You can do something like this in your themes functions.php
See example:
function wpcm_contact_form() {
echo do_shortcode( '[contact-form-7 id="200" title="Contact form 1"]' );
}
add_action( '<strong>wpcm_vehicle_summary</strong>', 'wpcm_contact_form', 40);
Good luck! And don’t forget to update your [shortcode].
There are if i’m not mistaken more hooks available that you can try!
Simply replace wpcm_vehicle_summary with any other hook. This means you can show your form to different area’s/positions in the template.
-
This reply was modified 6 years, 3 months ago by Patrick.
ok let’s see if I understand
i have a contact form 7 like this:
[contact-form-7 id="857" title="usato"]
and have a page with a shordcode like this:
[wpcm_cars]
and in my wp-content/themes/functions.php i have added
/** add contact form to wp car manager */
function wpcm_contact_form() {
echo do_shortcode( '[contact-form-7 id="857" title="usato"]' );
}
add_action( '<strong>wpcm_cars</strong>', 'wpcm_contact_form', 40);
But … nothing change …. if i click on button they open my local mail client
the contact form should be displayed on the location under the button in your single/vehicle post. If you want to create a popup you need to implement it yourself and create your own button that open the modal with your contact form with eg the same code or a different approach and just remove the email so the standard contact/email button will disappear.
Hey there,
Sorry for not responding sooner. I’m closing this issue because it’s over 1 month old. If the issue still exists, please create a new ticket.
Thank you.
Kind Regards,
Barry Kooij