<?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>wpCanyon &#187; jQuery</title>
	<atom:link href="http://wpcanyon.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpcanyon.com</link>
	<description>Wordpress tutorials, articles, hacks, tricks and many more</description>
	<lastBuildDate>Thu, 10 Feb 2011 01:21:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>10 Awesome Tutorials Combining WordPress And jQuery</title>
		<link>http://wpcanyon.com/roundups/10-awesome-tutorials-combining-wordpress-and-jquery/</link>
		<comments>http://wpcanyon.com/roundups/10-awesome-tutorials-combining-wordpress-and-jquery/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 15:57:52 +0000</pubDate>
		<dc:creator>Boba</dc:creator>
				<category><![CDATA[Roundups]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wpcanyon.com/?p=371</guid>
		<description><![CDATA[Roundup of 10 awesome tutorials that combine WordPress and the most famous javascript library - jQuery. Enjoy.]]></description>
			<content:encoded><![CDATA[<h2><a href='http://net.tutsplus.com/tutorials/wordpress/how-to-create-a-better-wordpress-options-panel/' target='_blank'>How to Create a Better WordPress Options Panel</a></h2>
<p><a href='http://net.tutsplus.com/tutorials/wordpress/how-to-create-a-better-wordpress-options-panel/' target='_blank'><img src='http://wpcanyon.com/post-images/topwpjquery/top1.png' alt='How to Create a Better WordPress Options Panel' /></a></p>
<h2><a href='http://digwp.com/2009/07/display-a-random-post-with-ajax-refresh/' target='_blank'>Display a Random Post (with AJAX Refresh)</a></h2>
<p><a href='http://digwp.com/2009/07/display-a-random-post-with-ajax-refresh/' target='_blank'><img src='http://wpcanyon.com/post-images/topwpjquery/top2.png' alt='Display a Random Post with AJAX Refresh' /></a></p>
<h2><a href='http://wpcanyon.com/tipsandtricks/the-easy-way-to-make-wordpress-ajax-pagination-using-jquery/' target='_blank'>The Easy Way To Make WordPress Ajax Pagination Using jQuery</a></h2>
<p><a href='http://wpcanyon.com/tipsandtricks/the-easy-way-to-make-wordpress-ajax-pagination-using-jquery/' target='_blank'><img src='http://wpcanyon.com/post-images/topwpjquery/top3.png' alt='The Easy Way To Make WordPress Ajax Pagination Using jQuery' /></a></p>
<h2><a href='http://www.wphardcore.com/2010/5-tips-for-using-ajax-in-wordpress' target='_blank'>5 tips for using AJAX in WordPress</a></h2>
<p><a href='http://www.wphardcore.com/2010/5-tips-for-using-ajax-in-wordpress' target='_blank'><img src='http://wpcanyon.com/post-images/topwpjquery/top4.png' alt='5 tips for using AJAX in WordPress' /></a></p>
<h2><a href='http://digwp.com/2009/11/make-an-infinite-more-posts-section/' target='_blank'>Make an Infinite More-Posts Section</a></h2>
<p><a href='http://digwp.com/2009/11/make-an-infinite-more-posts-section/' target='_blank'><img src='http://wpcanyon.com/post-images/topwpjquery/top5.png' alt='Make an Infinite More Posts Section' /></a></p>
<h2><a href='http://desizntech.info/2010/02/wordpress-and-jquery-troubleshooting-implementing-sidebar-tabs-and-more/' target='_blank'>WordPress and jQuery: Troubleshooting, Implementing Sidebar Tabs and More</a></h2>
<p><a href='http://desizntech.info/2010/02/wordpress-and-jquery-troubleshooting-implementing-sidebar-tabs-and-more/' target='_blank'><img src='http://wpcanyon.com/post-images/topwpjquery/top6.png' alt='Wordpress and jQuery Troubleshooting Implementing Sidebar Tabs and More' /></a></p>
<h2><a href='http://css-tricks.com/video-screencasts/81-ajaxing-a-wordpress-theme/' target='_blank'>AJAXing a WordPress Theme (screencast)</a></h2>
<p><a href='http://css-tricks.com/video-screencasts/81-ajaxing-a-wordpress-theme/' target='_blank'><img src='http://wpcanyon.com/post-images/topwpjquery/top7.png' alt='AJAXing a WordPress Theme' /></a></p>
<h2><a href='http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/' target='_blank'>5 Tips For Using jQuery With WordPress</a></h2>
<p><a href='http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/' target='_blank'><img src='http://wpcanyon.com/post-images/topwpjquery/top8.png' alt='5 Tips For Using jQuery With WordPress' /></a></p>
<h2><a href='http://armeda.com/how-to-create-a-jquery-carousel-with-WordPress-posts/' target='_blank'>Create a jQuery Carousel with WordPress Posts</a></h2>
<p><a href='http://armeda.com/how-to-create-a-jquery-carousel-with-WordPress-posts/' target='_blank'><img src='http://wpcanyon.com/post-images/topwpjquery/top9.png' alt='Create a jQuery Carousel with WordPress Posts' /></a></p>
<h2><a href='http://digwp.com/2009/09/integrating-fading-button-navigation/' target='_blank'>Integrating Fading Button Navigation</a></h2>
<p><a href='http://digwp.com/2009/09/integrating-fading-button-navigation/' target='_blank'><img src='http://wpcanyon.com/post-images/topwpjquery/top10.png' alt='Integrating Fading Button Navigation' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanyon.com/roundups/10-awesome-tutorials-combining-wordpress-and-jquery/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>2 Different Ways For Getting Twitter Status / PHP and jQuery</title>
		<link>http://wpcanyon.com/tipsandtricks/2-different-ways-for-getting-twitter-status-php-and-jquery/</link>
		<comments>http://wpcanyon.com/tipsandtricks/2-different-ways-for-getting-twitter-status-php-and-jquery/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 02:21:03 +0000</pubDate>
		<dc:creator>Boba</dc:creator>
				<category><![CDATA[Tips&Tricks]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://wpcanyon.com/?p=185</guid>
		<description><![CDATA[Nearly everyone who has a website and a twitter account shows their status on the website. Here are 2 different ways you can use to get the status and show it on your website.]]></description>
			<content:encoded><![CDATA[<h2>PHP</h2>
<p>Place the code bellow inside your theme&#8217;s <strong>function.php</strong> file. Don&#8217;t forget to change the <em>&#8220;TwitterProfileName&#8221;</em> with your twitter profile name.</p>
<pre class="brush: php;">
function parse_feed($feed) {
    $stepOne = explode(&quot;&lt;content type=\&quot;html\&quot;&gt;&quot;, $feed);
    $stepTwo = explode(&quot;&lt;/content&gt;&quot;, $stepOne[1]);
    $tweet = $stepTwo[0];
    $tweet = str_replace(&quot;&amp;lt;&quot;, &quot;&lt;&quot;, $tweet);
    $tweet = str_replace(&quot;&amp;gt;&quot;, &quot;&gt;&quot;, $tweet);
    return $tweet;
}

function getTweet(){
$feed = &quot;http://search.twitter.com/search.atom?q=from:TwitterProfileName&amp;rpp=1&quot;;
$twitterFeed = file_get_contents($feed);
echo parse_feed($twitterFeed);
}
</pre>
<p>Now wherever you like to show the twitter status just call the <strong>getTweet()</strong> function. </p>
<h2>jQuery</h2>
<pre class="brush: jscript;">
$.getJSON(&quot;http://twitter.com/statuses/user_timeline/username.json?callback=?&quot;, function(data) {
     $(&quot;#theIdOfTheElement&quot;).html(data[0].text);
});
</pre>
<p>Change <em>&#8220;#theIdOfTheElement&#8221;</em> with the ID of the element you want to show the twitter status in.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanyon.com/tipsandtricks/2-different-ways-for-getting-twitter-status-php-and-jquery/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>The Easy Way To Make WordPress Ajax Pagination Using jQuery</title>
		<link>http://wpcanyon.com/tipsandtricks/the-easy-way-to-make-wordpress-ajax-pagination-using-jquery/</link>
		<comments>http://wpcanyon.com/tipsandtricks/the-easy-way-to-make-wordpress-ajax-pagination-using-jquery/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 09:15:01 +0000</pubDate>
		<dc:creator>Boba</dc:creator>
				<category><![CDATA[Tips&Tricks]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[pagination]]></category>

		<guid isPermaLink="false">http://wpcanyon.com/?p=35</guid>
		<description><![CDATA[Making your paginated content in WordPress load using AJAX is extremely easy using a bit of jQuery. Here is how.]]></description>
			<content:encoded><![CDATA[<h2>Demonstration</h2>
<p><object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0' width='560' height='345'><param name='movie' value='http://screenr.com/Content/assets/screenr_1116090935.swf' /><param name='flashvars' value='i=52328' /><param name='allowFullScreen' value='true' /><embed src='http://screenr.com/Content/assets/screenr_1116090935.swf' flashvars='i=52328' allowFullScreen='true' width='560' height='345' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></object></p>
<h2>Solution</h2>
<pre class="brush: php;">
&lt;ul&gt;
	&lt;li&gt;&lt;?php next_posts_link('&amp;laquo; Older Entries') ?&gt;&lt;/li&gt;
	&lt;li&gt;&lt;?php previous_posts_link('Newer Entries &amp;raquo;') ?&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>The code above is used to make the previous and next page for the posts. First we need to add an ID for the unordered list so we can add select it using jQuery later. Let&#8217;s give it ID &#8216;postPagination&#8217;.</p>
<pre class="brush: php;">
&lt;ul id='postPagination'&gt;
	&lt;li&gt;&lt;?php next_posts_link('&amp;laquo; Older Entries') ?&gt;&lt;/li&gt;
	&lt;li&gt;&lt;?php previous_posts_link('Newer Entries &amp;raquo;') ?&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>Now let&#8217;s make it work with ajax. Insert the code bellow in <strong>header.php</strong> file of your theme. </p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
jQuery(document).ready(function(){

	jQuery('#postPagination a').live('click', function(e){
		e.preventDefault();
		var link = jQuery(this).attr('href');
		jQuery('#content').html('Loading...');
		jQuery('#content').load(link+' #contentInner');

	});

});
&lt;/script&gt;
</pre>
<p>Change the <strong>#content</strong> with ID of the div that wraps the <strong>#contentInner</strong> div of your page.</p>
<p>Here is how the layout looks.</p>
<pre class="brush: xml;">
&lt;div id='content'&gt;
    &lt;div id='contentInner'&gt;
        The Posts and the navigation are here
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>That&#8217;s it. Now when a link for previous or next post pages is clicked the new content will be loaded using ajax. If you are having troubles with these just say what&#8217;s your problem in the comments and i&#8217;ll do my best to help you.</p>
<p><em>Notice: Don&#8217;t forget to include the <a href='http://jquery.com'>jQuery library</a> inside the theme if it&#8217;s not already included.</em></p>
<h2>Bonus example: Fading animation</h2>
<p>Just change the javascript part to be like the snippet bellow.</p>
<pre class="brush: jscript;">
jQuery(document).ready(function(){

	jQuery('#postPagination a').live('click', function(e){
		e.preventDefault();
		var link = jQuery(this).attr('href');
		jQuery('#content').fadeOut(500).load(link + ' #contentInner', function(){ jQuery('#content').fadeIn(500); });

	});

});
</pre>
<p>That&#8217;s all. You can also <a href='/files/ajaxPaginationFade.zip'>download the files</a> which include the fading animation.</p>
<p><strong>Update:</strong><br />
<em>You can now <a href='/files/ajaxPagination.zip'>download the modified files</a>. The files are from the &#8220;Classic&#8221; wordpress theme that comes with the wordpress download.</em></p>
<p><strong>Update:</strong><br />
<em>Improved code and added a &#8220;loading&#8221; message. (the download files are also updated).</em></p>
<p><strong>Update:</strong><br />
<em>Bonus example added with fadeIn and fadeOut. You can <a href='/files/ajaxPaginationFade.zip'>download the files from the example.</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanyon.com/tipsandtricks/the-easy-way-to-make-wordpress-ajax-pagination-using-jquery/feed/</wfw:commentRss>
		<slash:comments>75</slash:comments>
		</item>
	</channel>
</rss>

