<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WP Engineer &#187; Contact Form</title>
	<atom:link href="http://wpengineer.com/tag/contact-form/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpengineer.com</link>
	<description>WordPress News, Hacks, Tips, Tutorials, Plugins and Themes</description>
	<lastBuildDate>Sun, 22 Jan 2012 13:32:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Contactable &#8211; Contact Form Easy with WordPress</title>
		<link>http://wpengineer.com/1936/contactable-contaktform-easy-with-wordpress/</link>
		<comments>http://wpengineer.com/1936/contactable-contaktform-easy-with-wordpress/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 11:07:45 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Contact Form]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1936</guid>
		<description><![CDATA[The integration of a contact form in WordPress usually begins with a search of a Plugin and often ends with a great effort too. Since scripts are loaded on all pages and posts - only to be integrated on one side of a form. The blog is only as good as his technician and I [...]]]></description>
			<content:encoded><![CDATA[<p>The integration of a contact form in WordPress usually begins with a search of a Plugin and often ends with a great effort too. Since scripts are loaded on all pages and posts - only to be integrated on one side of a form. The blog is only as good as his technician and I would like to show a very simple way how to integrate a contact form into your own blog without much knowledge.<br />
<span id="more-1936"></span><br />
The solution is not the holy grail, but it shows how easy and resource friendly it is to integrate a contact form in WordPress.<br />
So that we can devote ourselves fully to the integration, and we do not have to deal with PHP and JavaScript, I'll use for the example the great form Plugin <a href="http://theodin.co.uk/blog/ajax/contactable-jquery-plugin.html"><strong>contactable</strong></a> for jQuery by Philip Beel. This Plugin brings all the necessary files and only needs to be integrated - very easy to use and you can adapt to your own needs. Documentation can be found on the <a href="http://theodin.co.uk/blog/ajax/contactable-jquery-plugin.html">Plugin site</a>. For the integration of the form I use the standard Kubrick theme on WordPress, but you can use it in any other theme.</p>
<p><img src="http://wpengineer.com/wp-content/uploads/contactable.png" alt="" title="contactable" width="450" height="316" class="aligncenter size-full wp-image-1937" /></p>
<p>WordPress provides the jQuery library. The calling of all the necessary files and scripts will take place within the template, which takes care to output the contact form. This call we'll do with the functions of WordPress - so we make sure that the files really are loaded only once. WordPress takes care of the correct order and of the dependencies.</p>
<p>First we create a template, I call it <code>contact-page.php</code> and it must be stored in the folder of your themes. This includes calling the necessary scripts and the associated stylesheets. Basically, you only need these four calls to store in the <code>page.php</code> of your theme, assign a new name for the file and put a comment to get recognized by WordPress (at the beginning the file). The following describes the syntax of the example of <code>page.php</code> in the default theme Kubrick.</p>
<pre lang="php">
&lt;?php
/**
 * Template Name: Contact Page
 *
 * @package WordPress
 * @subpackage Default_Theme
 */

wp_enqueue_script( &#039;jquery.contactable&#039;, get_bloginfo(&#039;template_directory&#039;) . &#039;/contactable/jquery.contactable.js&#039;, array(&#039;jquery&#039;) , 3.1, true );
wp_enqueue_script( &#039;jquery.validate&#039;, get_bloginfo(&#039;template_directory&#039;) . &#039;/contactable/jquery.validate.pack.js&#039;, array(&#039;jquery&#039;) , 3.1, true );
wp_enqueue_script( &#039;my_contactable&#039;, get_bloginfo(&#039;template_directory&#039;) . &#039;/contactable/my_contactable.js&#039;, array(&#039;jquery&#039;) , 3.1, true );
wp_enqueue_style( &#039;contactable&#039;, get_bloginfo(&#039;template_directory&#039;) . &#039;/contactable/contactable.css&#039; );

get_header(); ?&gt;

    &lt;div id=&quot;content&quot; class=&quot;narrowcolumn&quot; role=&quot;main&quot;&gt;

        &lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;
        &lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;

            &lt;div class=&quot;entry&quot;&gt;
                &lt;?php the_content(&#039;&lt;p class=&quot;serif&quot;&gt;Read the rest of this page &raquo;&lt;/p&gt;&#039;); ?&gt;

                &lt;div id=&quot;mycontactform&quot;&gt; &lt;/div&gt;

            &lt;/div&gt;
        &lt;/div&gt;

    &lt;/div&gt;

&lt;?php get_sidebar(); ?&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>As you can see in the syntax, I have saved all files of the jQuery Form Plugnis in the folder <code>contactable</code> in the folder of the theme. Therefore, your paths may have to be adjusted. Right now it looks like this in my theme:</p>
<ul>
<li>
default
<ul>
<li>contactable
<ul>
<li>jquery.contactable.js</li>
<li>jquery.validate.pack.jss</li>
<li>my.contactable.js</li>
<li>contactable.css</li>
</ul>
</li>
<li>style.css</li>
<li>contact-page.php</li>
<li>...</li>
</ul>
</li>
</ul>
<p>I only added the file <code>my.contactable.js</code>; this takes care to call the form and can be filled with parameters. Their content is as follows:</p>
<pre lang="php">
jQuery(document).ready( function($){
    $(&#039;#mycontactform&#039;).contactable({
        name: &#039;Name&#039;,
        email: &#039;E-Mail&#039;,
        message : &#039;Message&#039;,
        recipient: &#039;example@domain.com&#039;,
        subject: &#039;Contact Form&#039;,
        recievedMsg : &#039;Thanks for your message.&#039;
    });
});
</pre>
<p>If all files are stored and are adapted to your needs, then you only need to create a page in the admin area of WordPress. Give the page a name, if you want fill it with content and select a template - in our case the <strong>Contact Page</strong>. After saving the page, you should view it in the front end and click on the small label and the form will appear and can be filled out.</p>
<p>Through the call with the help of WordPress functions and the right parameters, the scripts are now integrated  in the footer of the site. The jQuery library will not be called, it will be added by WordPress if it is not there yet, by the dependence of the parameters for the key <code>jquery</code>. By using a template with all calls, all the scripts and stylesheets are only involved if the page is called by WordPress. If you want the form snippets on all sides, you can insert the call in the <code>header.php</code> or <code>functions.php</code>.</p>
<p><img src="http://wpengineer.com/wp-content/uploads/contactable-ocss.png" alt="" title="contactable-ocss" width="450" height="533" class="aligncenter size-full wp-image-1938" /></p>
<p>You do not want to use this feature, then either don't use that CSS, or add your own design or you can fit the JS to your own needs. The same applies for additional fields in the form, this must be adapted to the content of the files.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1936/contactable-contaktform-easy-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

