<?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: How to load Javascript on specific pages in WordPress</title>
	<atom:link href="http://www.fldtrace.com/wordpress/load-javascript-on-specific-pages-in-wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.fldtrace.com/wordpress/load-javascript-on-specific-pages-in-wordpress</link>
	<description></description>
	<lastBuildDate>Tue, 03 Jan 2012 23:18:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: kylu</title>
		<link>http://www.fldtrace.com/wordpress/load-javascript-on-specific-pages-in-wordpress/comment-page-1#comment-13822</link>
		<dc:creator>kylu</dc:creator>
		<pubDate>Sun, 14 Aug 2011 21:37:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.fldtrace.com/wordpress/load-javascript-just-on-specific-pages-in-wordpress#comment-13822</guid>
		<description>Hi there, 

a simple question what would be a function to activate a plugins js only on 2 different pages.

I have a lightbox working on page 1. and page 2. i dont need it on the rest of them. 

This code gives the chance to activate it only on one.

add_action( &#039;wp_print_scripts&#039;, &#039;my_deregister_javascript&#039;, 100 );
 
function my_deregister_javascript() {
   if ( !is_page(&#039;Contact&#039;) ) {
	wp_deregister_script( &#039;contact-form-7&#039; );
     }
}

Thx for your help
k..</description>
		<content:encoded><![CDATA[<p>Hi there, </p>
<p>a simple question what would be a function to activate a plugins js only on 2 different pages.</p>
<p>I have a lightbox working on page 1. and page 2. i dont need it on the rest of them. </p>
<p>This code gives the chance to activate it only on one.</p>
<p>add_action( &#8216;wp_print_scripts&#8217;, &#8216;my_deregister_javascript&#8217;, 100 );</p>
<p>function my_deregister_javascript() {<br />
   if ( !is_page(&#8216;Contact&#8217;) ) {<br />
	wp_deregister_script( &#8216;contact-form-7&#8242; );<br />
     }<br />
}</p>
<p>Thx for your help<br />
k..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Art</title>
		<link>http://www.fldtrace.com/wordpress/load-javascript-on-specific-pages-in-wordpress/comment-page-1#comment-12622</link>
		<dc:creator>Art</dc:creator>
		<pubDate>Mon, 27 Jun 2011 01:35:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.fldtrace.com/wordpress/load-javascript-just-on-specific-pages-in-wordpress#comment-12622</guid>
		<description>Exactly what I was looking for!  Thanks Lucian.  I was adding Adwords Javascript conversion code to a Wordpress template and knew this was easy to do but thanks to your tutorial, I was able to save some time so thank you.</description>
		<content:encoded><![CDATA[<p>Exactly what I was looking for!  Thanks Lucian.  I was adding Adwords Javascript conversion code to a WordPress template and knew this was easy to do but thanks to your tutorial, I was able to save some time so thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://www.fldtrace.com/wordpress/load-javascript-on-specific-pages-in-wordpress/comment-page-1#comment-10639</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Mon, 23 May 2011 15:51:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.fldtrace.com/wordpress/load-javascript-just-on-specific-pages-in-wordpress#comment-10639</guid>
		<description>Thanks for your reply Lucian, I&#039;ve re-coded all my gallery plugins to avoid using plugins altogether, it&#039;s fancybox plugin I&#039;m referring to here and luckily my custom header idea will work fine in this instance.

At this stage if I had a plugin that offered me no choice I&#039;d not use it, or use your idea if needed. My point was that if it&#039;s a few pages an array is all good but if you have loads of pages perhaps a custom header would be a better solution.</description>
		<content:encoded><![CDATA[<p>Thanks for your reply Lucian, I&#8217;ve re-coded all my gallery plugins to avoid using plugins altogether, it&#8217;s fancybox plugin I&#8217;m referring to here and luckily my custom header idea will work fine in this instance.</p>
<p>At this stage if I had a plugin that offered me no choice I&#8217;d not use it, or use your idea if needed. My point was that if it&#8217;s a few pages an array is all good but if you have loads of pages perhaps a custom header would be a better solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucian Florian</title>
		<link>http://www.fldtrace.com/wordpress/load-javascript-on-specific-pages-in-wordpress/comment-page-1#comment-10637</link>
		<dc:creator>Lucian Florian</dc:creator>
		<pubDate>Mon, 23 May 2011 15:15:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.fldtrace.com/wordpress/load-javascript-just-on-specific-pages-in-wordpress#comment-10637</guid>
		<description>Simon, it&#039;s better not load JS on pages you don&#039;t need. It may also affect SEO if you have inline JS, which should actually be included in a separated file. Certain plugins they force load this into header and you might not have much of an option.</description>
		<content:encoded><![CDATA[<p>Simon, it&#8217;s better not load JS on pages you don&#8217;t need. It may also affect SEO if you have inline JS, which should actually be included in a separated file. Certain plugins they force load this into header and you might not have much of an option.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://www.fldtrace.com/wordpress/load-javascript-on-specific-pages-in-wordpress/comment-page-1#comment-10634</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Mon, 23 May 2011 14:59:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.fldtrace.com/wordpress/load-javascript-just-on-specific-pages-in-wordpress#comment-10634</guid>
		<description>Thanks for this tutorial, I&#039;m wondering whether it would be more efficient to use a custom header template for all pages using custom JS. I figure that it&#039;s faster to keep the array smaller (or get rid entirely) to save server resources.

I have around 50+ pages I&#039;d have to add to this array and these pages would all appear in my source for every page on my site and is not very good for SEO is it? 

Although a custom header is arguably more coding work it is better in my opinion as it keeps things cleaner and leaves the non-JS pages free of a massive array which search engines would have to navigate through on every page, before they get to actual page content. Effectively on the custom header pages we still only have a couple/three/four &#039;link rel=&#039; statements as opposed to a list of 50+ pages in my case.

What do you think?</description>
		<content:encoded><![CDATA[<p>Thanks for this tutorial, I&#8217;m wondering whether it would be more efficient to use a custom header template for all pages using custom JS. I figure that it&#8217;s faster to keep the array smaller (or get rid entirely) to save server resources.</p>
<p>I have around 50+ pages I&#8217;d have to add to this array and these pages would all appear in my source for every page on my site and is not very good for SEO is it? </p>
<p>Although a custom header is arguably more coding work it is better in my opinion as it keeps things cleaner and leaves the non-JS pages free of a massive array which search engines would have to navigate through on every page, before they get to actual page content. Effectively on the custom header pages we still only have a couple/three/four &#8216;link rel=&#8217; statements as opposed to a list of 50+ pages in my case.</p>
<p>What do you think?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucian</title>
		<link>http://www.fldtrace.com/wordpress/load-javascript-on-specific-pages-in-wordpress/comment-page-1#comment-1094</link>
		<dc:creator>Lucian</dc:creator>
		<pubDate>Mon, 08 Mar 2010 13:25:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.fldtrace.com/wordpress/load-javascript-just-on-specific-pages-in-wordpress#comment-1094</guid>
		<description>Glad you like it.</description>
		<content:encoded><![CDATA[<p>Glad you like it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Omer Greenwald</title>
		<link>http://www.fldtrace.com/wordpress/load-javascript-on-specific-pages-in-wordpress/comment-page-1#comment-1093</link>
		<dc:creator>Omer Greenwald</dc:creator>
		<pubDate>Mon, 08 Mar 2010 08:54:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.fldtrace.com/wordpress/load-javascript-just-on-specific-pages-in-wordpress#comment-1093</guid>
		<description>Very good post, Lucian. I wrote about handling unwanted scripts and styles as well</description>
		<content:encoded><![CDATA[<p>Very good post, Lucian. I wrote about handling unwanted scripts and styles as well</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucian</title>
		<link>http://www.fldtrace.com/wordpress/load-javascript-on-specific-pages-in-wordpress/comment-page-1#comment-1053</link>
		<dc:creator>Lucian</dc:creator>
		<pubDate>Wed, 24 Feb 2010 15:54:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.fldtrace.com/wordpress/load-javascript-just-on-specific-pages-in-wordpress#comment-1053</guid>
		<description>You cannot do that in Blogspot. If you transfer your blog to Wordpress, than you can apply the points from above.</description>
		<content:encoded><![CDATA[<p>You cannot do that in Blogspot. If you transfer your blog to WordPress, than you can apply the points from above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Avinash</title>
		<link>http://www.fldtrace.com/wordpress/load-javascript-on-specific-pages-in-wordpress/comment-page-1#comment-1050</link>
		<dc:creator>Avinash</dc:creator>
		<pubDate>Wed, 24 Feb 2010 10:28:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.fldtrace.com/wordpress/load-javascript-just-on-specific-pages-in-wordpress#comment-1050</guid>
		<description>How can we use this in Blogspot ? Please Help.. Will be thank ful</description>
		<content:encoded><![CDATA[<p>How can we use this in Blogspot ? Please Help.. Will be thank ful</p>
]]></content:encoded>
	</item>
</channel>
</rss>

