I would love to find this out too so i can put this into a layout rather then using de text editor in wp.
Hello!
I tried the code you highlighted in your website Devic, but it is not working for me.
I get the next error:
Fatal error: Call to a member function form_scan_shortcode() on a non-object in /…/public_html/wp-content/plugins/contact-form-7/modules/file.php on line 63
Any idea?
Thanks in advanced
Sorry, I have tested this code only localy on XAMPP and it worked. You only need to add:
global $wpcf7_contact_form;
as first line of php code, I have updated post on my website.
Unfortunately I have not been able to get this code working…just produces page errors in ie and stalls out when trying to submit the form.
Thanks very much…that worked great π
The code I’ve posted works on my site and in XAMPP just copy paste it. The do_shortcode() works to, I didn’t know about do_shortcode() function. Thank you Kawauso.
I’m not sure why I couldn’t get your invocation code to work, but the do_shortcode() function seems to be something that probably won’t be affected by updates and newer versions, so probably a better option.
Hi guys, I think I’m having the same problem, trying to embed Contact Form 7 into my template php file.
semrocc, do you mind showing how you use the do_shortcode() function?
I’m a noob in php…
Just change the number and name of the contact form
<?php echo do_shortcode(“[contact-form 1 'Contact form 1']“); ?>
Yes…exactly as above…thanks
A useful “Invocation code” ! Thanx for the “do_shortcode” I needed !
Thank you semrocc and devicbojan the do shortcode is what I needed too!