feedback

Contact form 7 PHP Invocation Code

Contact form 7 is one of the most popular plugins for WordPress. Currently it’s 6th most downloaded plugin for WordPress. It’s very customizable at it can be easily integrated in posts and pages. That’s great but people sometimes want to integrate it in sidebar, header or footer so that it can be accessed on multiply pages. Looking at the code of plugin I found out that you need to use just a couple of lines of code to do that, just copy/paste this code:

<?php
global $wpcf7_contact_form;
if ( ! ( $wpcf7_contact_form = wpcf7_contact_form( 1 ) ) )
return 'Contact form not found!';
$form = $wpcf7_contact_form->form_html();
echo $form;
?>

Just change the number 1 in wpcf7_contact_form( 1 ) to number of your contact form you need.

Digg icon Delicous icon Stumbleupon icon Reddit icon Twitter icon Facebook icon Technorati icon

2 Comments to Contact form 7 PHP Invocation Code

  1. 13. December 2009. at 14:38 | Permalink

    I just want to tell you that your blog is very interesting, bookmarked

  2. 2. February 2010. at 12:07 | Permalink

    Good work buddy , keep us posting

Leave a Reply

You can use some HTML tags

Random Quote

quote openIf McDonalds were run like a software company, one out of every hundred Big Macs would give you food poisoning, and the response would be, ‘We’re sorry, here’s a coupon for two more.quote end
by Mark Minasi

Tag cloud