<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Loading JavaScript and Stylesheet Only When it is Necessary</title>
	<atom:link href="http://contactform7.com/2009/11/22/loading-javascript-and-stylesheet-only-when-it-is-necessary/feed/" rel="self" type="application/rss+xml" />
	<link>http://contactform7.com/2009/11/22/loading-javascript-and-stylesheet-only-when-it-is-necessary/</link>
	<description>Just another contact form plugin for WordPress. Simple but flexible.</description>
	<lastBuildDate>Wed, 27 Jan 2010 02:43:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: John Roberts</title>
		<link>http://contactform7.com/2009/11/22/loading-javascript-and-stylesheet-only-when-it-is-necessary/comment-page-1/#comment-267</link>
		<dc:creator>John Roberts</dc:creator>
		<pubDate>Wed, 27 Jan 2010 01:27:08 +0000</pubDate>
		<guid isPermaLink="false">http://contactform7.com/?p=466#comment-267</guid>
		<description>Appreciate these instructions, and the comments, especially that from Christian Schenk. I was worried about mucking with the PHP files, but your instructions were clear.

One note: make sure the single quote marks in your PHP file are _not_ smart quotes, as they appear in the comment above.

Thanks Takayuki for your continued development and improvement.</description>
		<content:encoded><![CDATA[<p>Appreciate these instructions, and the comments, especially that from Christian Schenk. I was worried about mucking with the PHP files, but your instructions were clear.</p>
<p>One note: make sure the single quote marks in your PHP file are _not_ smart quotes, as they appear in the comment above.</p>
<p>Thanks Takayuki for your continued development and improvement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Atkins</title>
		<link>http://contactform7.com/2009/11/22/loading-javascript-and-stylesheet-only-when-it-is-necessary/comment-page-1/#comment-78</link>
		<dc:creator>Ian Atkins</dc:creator>
		<pubDate>Fri, 04 Dec 2009 21:19:14 +0000</pubDate>
		<guid isPermaLink="false">http://contactform7.com/?p=466#comment-78</guid>
		<description>Hi Takayuki,

Thanks very much for a great plugin.

I&#039;m trying to disable the javascript and css with the lines below, in my wp-congif.php.

define (&#039;WPCF7_LOAD_JS&#039;, false);
define (&#039;WPCF7_LOAD_CSS&#039;, false);

Had a little stupid mistake, putting the lines right at the bottom of the config file. It has no effect unless you put it above the line below:

/* That&#039;s all, stop editing! Happy blogging. */

Hope this helps anyone else wondering why its not working!

Thanks.</description>
		<content:encoded><![CDATA[<p>Hi Takayuki,</p>
<p>Thanks very much for a great plugin.</p>
<p>I&#8217;m trying to disable the javascript and css with the lines below, in my wp-congif.php.</p>
<p>define (&#8216;WPCF7_LOAD_JS&#8217;, false);<br />
define (&#8216;WPCF7_LOAD_CSS&#8217;, false);</p>
<p>Had a little stupid mistake, putting the lines right at the bottom of the config file. It has no effect unless you put it above the line below:</p>
<p>/* That&#8217;s all, stop editing! Happy blogging. */</p>
<p>Hope this helps anyone else wondering why its not working!</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Schenk</title>
		<link>http://contactform7.com/2009/11/22/loading-javascript-and-stylesheet-only-when-it-is-necessary/comment-page-1/#comment-61</link>
		<dc:creator>Christian Schenk</dc:creator>
		<pubDate>Tue, 01 Dec 2009 23:05:27 +0000</pubDate>
		<guid isPermaLink="false">http://contactform7.com/?p=466#comment-61</guid>
		<description>Agree. Thank you for discussing this with me.</description>
		<content:encoded><![CDATA[<p>Agree. Thank you for discussing this with me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Takayuki Miyoshi</title>
		<link>http://contactform7.com/2009/11/22/loading-javascript-and-stylesheet-only-when-it-is-necessary/comment-page-1/#comment-59</link>
		<dc:creator>Takayuki Miyoshi</dc:creator>
		<pubDate>Tue, 01 Dec 2009 22:57:07 +0000</pubDate>
		<guid isPermaLink="false">http://contactform7.com/?p=466#comment-59</guid>
		<description>Because there is no better way than this. Note that many users put thier contact forms in posts (they will be shown on index page and archive pages) and sidebar widgets. In such cases, setting post meta doesn&#039;t work.</description>
		<content:encoded><![CDATA[<p>Because there is no better way than this. Note that many users put thier contact forms in posts (they will be shown on index page and archive pages) and sidebar widgets. In such cases, setting post meta doesn&#8217;t work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Schenk</title>
		<link>http://contactform7.com/2009/11/22/loading-javascript-and-stylesheet-only-when-it-is-necessary/comment-page-1/#comment-56</link>
		<dc:creator>Christian Schenk</dc:creator>
		<pubDate>Tue, 01 Dec 2009 16:30:26 +0000</pubDate>
		<guid isPermaLink="false">http://contactform7.com/?p=466#comment-56</guid>
		<description>Don&#039;t you think that this is something a lot of people might want to do? Why not build it into the plugin?</description>
		<content:encoded><![CDATA[<p>Don&#8217;t you think that this is something a lot of people might want to do? Why not build it into the plugin?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Takayuki Miyoshi</title>
		<link>http://contactform7.com/2009/11/22/loading-javascript-and-stylesheet-only-when-it-is-necessary/comment-page-1/#comment-45</link>
		<dc:creator>Takayuki Miyoshi</dc:creator>
		<pubDate>Sat, 28 Nov 2009 23:22:36 +0000</pubDate>
		<guid isPermaLink="false">http://contactform7.com/?p=466#comment-45</guid>
		<description>Or, you can write an extra helper plugin on your own which does once &lt;a href=&quot;http://justintadlock.com/archives/2009/08/06/how-to-disable-scripts-and-styles&quot; rel=&quot;nofollow&quot;&gt;deregister the script&lt;/a&gt; and enqueue it again if the post has &#039;cf7&#039; meta.</description>
		<content:encoded><![CDATA[<p>Or, you can write an extra helper plugin on your own which does once <a href="http://justintadlock.com/archives/2009/08/06/how-to-disable-scripts-and-styles" rel="nofollow">deregister the script</a> and enqueue it again if the post has &#8216;cf7&#8242; meta.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Schenk</title>
		<link>http://contactform7.com/2009/11/22/loading-javascript-and-stylesheet-only-when-it-is-necessary/comment-page-1/#comment-44</link>
		<dc:creator>Christian Schenk</dc:creator>
		<pubDate>Sat, 28 Nov 2009 22:30:24 +0000</pubDate>
		<guid isPermaLink="false">http://contactform7.com/?p=466#comment-44</guid>
		<description>It has worked for me so far because I&#039;ve always put my forms on a separate page. Anyway, I&#039;d love to see something like this incorporated into the plugin - adding the code after every update is quite annoying.</description>
		<content:encoded><![CDATA[<p>It has worked for me so far because I&#8217;ve always put my forms on a separate page. Anyway, I&#8217;d love to see something like this incorporated into the plugin &#8211; adding the code after every update is quite annoying.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Takayuki Miyoshi</title>
		<link>http://contactform7.com/2009/11/22/loading-javascript-and-stylesheet-only-when-it-is-necessary/comment-page-1/#comment-43</link>
		<dc:creator>Takayuki Miyoshi</dc:creator>
		<pubDate>Sat, 28 Nov 2009 19:54:55 +0000</pubDate>
		<guid isPermaLink="false">http://contactform7.com/?p=466#comment-43</guid>
		<description>Looks like a nice hack. If you show a form only on a singular page (I mean, non-archive pages), this should work. Thanks Christian.</description>
		<content:encoded><![CDATA[<p>Looks like a nice hack. If you show a form only on a singular page (I mean, non-archive pages), this should work. Thanks Christian.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Schenk</title>
		<link>http://contactform7.com/2009/11/22/loading-javascript-and-stylesheet-only-when-it-is-necessary/comment-page-1/#comment-42</link>
		<dc:creator>Christian Schenk</dc:creator>
		<pubDate>Sat, 28 Nov 2009 19:03:24 +0000</pubDate>
		<guid isPermaLink="false">http://contactform7.com/?p=466#comment-42</guid>
		<description>Using the most recent version (2.0.7) of Contact Form 7 you can change a little portion of the plugin to make this more flexible using custom fields.

Just open the file &lt;code&gt;controller.php&lt;/code&gt; which is located in the plugin&#039;s directory under &lt;code&gt;includes&lt;/code&gt; and add the following code right at the beginning of the functions &lt;code&gt;wpcf7_enqueue_scripts&lt;/code&gt; and &lt;code&gt;wpcf7_enqueue_styles&lt;/code&gt;, i.e. right after the curly brackets on a new line:

global $post;
if (get_post_meta($post-&gt;ID, &#039;cf7&#039;, true) != &#039;1&#039;) return;


This way only posts/pages containing a custom field &lt;em&gt;cf7&lt;/em&gt; with its value set to &lt;em&gt;1&lt;/em&gt; will load the corresponding CSS/JavaScript.

Regarding the example above you should add a custom field to the page &quot;Contact&quot; and the form will work on this particular page.</description>
		<content:encoded><![CDATA[<p>Using the most recent version (2.0.7) of Contact Form 7 you can change a little portion of the plugin to make this more flexible using custom fields.</p>
<p>Just open the file <code>controller.php</code> which is located in the plugin&#8217;s directory under <code>includes</code> and add the following code right at the beginning of the functions <code>wpcf7_enqueue_scripts</code> and <code>wpcf7_enqueue_styles</code>, i.e. right after the curly brackets on a new line:</p>
<p>global $post;<br />
if (get_post_meta($post-&gt;ID, &#8216;cf7&#8242;, true) != &#8216;1&#8242;) return;</p>
<p>This way only posts/pages containing a custom field <em>cf7</em> with its value set to <em>1</em> will load the corresponding CSS/JavaScript.</p>
<p>Regarding the example above you should add a custom field to the page &#8220;Contact&#8221; and the form will work on this particular page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Defiscaliser Scellier</title>
		<link>http://contactform7.com/2009/11/22/loading-javascript-and-stylesheet-only-when-it-is-necessary/comment-page-1/#comment-20</link>
		<dc:creator>Defiscaliser Scellier</dc:creator>
		<pubDate>Mon, 23 Nov 2009 15:46:42 +0000</pubDate>
		<guid isPermaLink="false">http://contactform7.com/?p=466#comment-20</guid>
		<description>I use Form7 WP plugin

I&#039;d like to add the adwords google counter tag on the page &quot;Email sent ok&quot; ... How can I do this ? That will help me drive my adwords campaigns with a CPA

Thanks for your answer 
David</description>
		<content:encoded><![CDATA[<p>I use Form7 WP plugin</p>
<p>I&#8217;d like to add the adwords google counter tag on the page &#8220;Email sent ok&#8221; &#8230; How can I do this ? That will help me drive my adwords campaigns with a CPA</p>
<p>Thanks for your answer<br />
David</p>
]]></content:encoded>
	</item>
</channel>
</rss>
