<?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>KNGUYENTU - PHOTOGRAPHY BY KEVIN &#38; SAP HELP BY KEVIN &#187; Paginate</title>
	<atom:link href="http://knguyentu.com/wordpress/tag/paginate/feed/" rel="self" type="application/rss+xml" />
	<link>http://knguyentu.com/wordpress</link>
	<description>Home Of SAPHELPBYKEVIN.COM , PHOTOGRAPHYBYKEVIN.NET &#38; Smilepak Blog</description>
	<lastBuildDate>Thu, 05 Nov 2009 21:37:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WP: Splitting Category Listing Into Multiple Pages</title>
		<link>http://knguyentu.com/wordpress/2008/06/wp-splitting-category-listing-into-multiple-pages/</link>
		<comments>http://knguyentu.com/wordpress/2008/06/wp-splitting-category-listing-into-multiple-pages/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 23:53:12 +0000</pubDate>
		<dc:creator>dikiem</dc:creator>
				<category><![CDATA[WordPress Tips and Hack]]></category>
		<category><![CDATA[Multiple Pages]]></category>
		<category><![CDATA[Paginate]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://knguyentu.com/wordpress/?p=146</guid>
		<description><![CDATA[Here is a little neat trick for Wordpress. Normally, you would use the WordPress tag &#8220;query_posts&#8221; to query against the database to list all of the posts relating to one or more categories.
Usually a simple query against a category would like something like this:

&#60;?php query_posts(showposts=5&#38;cat=$category);
while(have_posts()) { the_post();

}
?&#62;

Basically all this is doing is show 5 posts [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a little neat trick for Wordpress. Normally, you would use the WordPress tag &#8220;query_posts&#8221; to query against the database to list all of the posts relating to one or more categories.</p>
<p>Usually a simple query against a category would like something like this:</p>
<p><code><br />
&lt;?php query_posts(showposts=5&amp;cat=$category);<br />
while(have_posts()) { the_post();<br />
<!-- put your loop here --><br />
}<br />
?&gt;<br />
</code></p>
<p>Basically all this is doing is show 5 posts for the category, where $category is either one or more categories depending if you have a outter loop or not. What if you have a lot of posts per category and want to only show 5 per page. Plus you want to have the previous page and next page button. That would be cool huh?</p>
<p>You can easily do that. Using the above code as example, you can easily transform it to look like this.</p>
<p>&lt;?php $paged = (get_query_var(&#8216;paged&#8217;)) ? get_query_var(&#8216;paged&#8217;) : 1; ?&gt;<br />
&lt;?php query_posts(&#8220;cat=$category&amp;posts_per_page=5&amp;paged=$paged&#8221;);<br />
while(have_posts()) { the_post();<br />
<!-- put your loop here --><br />
}<br />
?&gt;</p>
<p>Somewhere else on that same page, you need to call the function code that handle the previous page and next page logic. They look something like this</p>
<p>&lt;?php next_posts_link(&#8216;« Next Page&#8217;) ?&gt;  ||  &lt;?php previous_posts_link(&#8216;Previous Page »&#8217;) ?&gt;</p>
<p>What you&#8217;ve just done essentially is use the get_query_var to capture from the url string what page is it currently on and pass that to the page. At the bottom, it detect what page is next and previous.</p>
<p>You can see a sample in action from the SAPHELPBYKEVIN page link above.</p>
<p><strong>Additional References:</strong><br />
Wordpress Query Post: http://codex.wordpress.org/Template_Tags/query_posts</p>

<div class='amazonfeed'><h2>Hot Items From Amazon!</h2>
<div class='product'><a href='http://www.amazon.com/David-Buschs-Quick-Photoblogging-Wordpress/dp/B0032K6MDY?SubscriptionId=0K71XE306HCHA9WYBS02&tag=photographbyk-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B0032K6MDY' target='_blank' rel='nofollow'><img src='http://ecx.images-amazon.com/images/I/31IeYUY5EuL._SL75_.jpg' class='amazonfeed-product-image' alt='David Busch&#039;s Quick Snap Guide to Photoblogging wwith Wordpress: An Instant Start-up Manual for Creating &amp; Promoting Your Photoblog, Softcover Book, 205 Pages' title='David Busch&#039;s Quick Snap Guide to Photoblogging wwith Wordpress: An Instant Start-up Manual for Creating &amp; Promoting Your Photoblog, Softcover Book, 205 Pages' /><span class='amazonfeed-product-title'>David Busch's Quick Snap Guide to Photoblogging wwith Wordpress: An Instant Start-up Manual for Creating & Promoting Your Photoblog, Softcover Book, 205 Pages</span></a>
</div></div>]]></content:encoded>
			<wfw:commentRss>http://knguyentu.com/wordpress/2008/06/wp-splitting-category-listing-into-multiple-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
