<?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: Better WordPress pagination</title>
	<atom:link href="http://sltaylor.co.uk/blog/better-wordpress-pagination/feed/" rel="self" type="application/rss+xml" />
	<link>http://sltaylor.co.uk/blog/better-wordpress-pagination/</link>
	<description>Freelance WordPress developer in London - XHTML, CSS &#38; design</description>
	<lastBuildDate>Wed, 28 Jul 2010 19:08:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Steve Taylor</title>
		<link>http://sltaylor.co.uk/blog/better-wordpress-pagination/#comment-7404</link>
		<dc:creator>Steve Taylor</dc:creator>
		<pubDate>Sun, 04 Jul 2010 20:33:15 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=149#comment-7404</guid>
		<description>Thanks Nadeeshyama. I still find $baseURL useful for when you&#039;re outputting posts in a loop on some custom page separate from the main blog, e.g. /news/. This is usually when I&#039;ve fudged different post &quot;types&quot; using categories, though of course WP 3.0 custom post types will make this kind of thing easier, and maybe $baseURL becomes even more relevant?</description>
		<content:encoded><![CDATA[<p>Thanks Nadeeshyama. I still find $baseURL useful for when you&#8217;re outputting posts in a loop on some custom page separate from the main blog, e.g. /news/. This is usually when I&#8217;ve fudged different post &#8220;types&#8221; using categories, though of course WP 3.0 custom post types will make this kind of thing easier, and maybe $baseURL becomes even more relevant?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nadeeshyama Talagala</title>
		<link>http://sltaylor.co.uk/blog/better-wordpress-pagination/#comment-7387</link>
		<dc:creator>Nadeeshyama Talagala</dc:creator>
		<pubDate>Sun, 04 Jul 2010 08:40:39 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=149#comment-7387</guid>
		<description>This is great. However I found a way to eliminate the need of $baseUrl. You can add the following to make the $baseUrl for any category eliminating the second argument to the function.

&lt;code&gt;
$url = get_bloginfo(&#039;url&#039;);
$baseUrl = &#039;&#039;;

$category_name = $query-&gt;query_vars[&#039;category_name&#039;];

if (is_string($category_name)) {
	$category_id = get_cat_ID($category_name);
	if (isset($category_id)) {
		$category_link = get_category_link($category_id);
		if (is_string($category_link)) {
			$baseUrl = $category_link . &#039;/&#039;;
		}
	}
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>This is great. However I found a way to eliminate the need of $baseUrl. You can add the following to make the $baseUrl for any category eliminating the second argument to the function.</p>
<p><code><br />
$url = get_bloginfo('url');<br />
$baseUrl = '';</p>
<p>$category_name = $query-&gt;query_vars['category_name'];</p>
<p>if (is_string($category_name)) {<br />
	$category_id = get_cat_ID($category_name);<br />
	if (isset($category_id)) {<br />
		$category_link = get_category_link($category_id);<br />
		if (is_string($category_link)) {<br />
			$baseUrl = $category_link . '/';<br />
		}<br />
	}<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Taylor</title>
		<link>http://sltaylor.co.uk/blog/better-wordpress-pagination/#comment-6516</link>
		<dc:creator>Steve Taylor</dc:creator>
		<pubDate>Wed, 12 May 2010 10:43:24 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=149#comment-6516</guid>
		<description>Ryan, glad you like the site! As to your issue, hard to tell what&#039;s going on from the outside. However, it seems clear that the issue is probably nothing to do with this pagination code. The URL http://abletonlife.com/news/page/2 is showing the same as http://abletonlife.com/news, so WP&#039;s paging itself isn&#039;t working. The only thing I can spot as a possible starting point is that there&#039;s no trailing slash on the URLs. If one is added, it gets removed. I can&#039;t remember whether it&#039;s a server-level thing or a WP thing, but in my experience the normal behaviour is for trailing slashes to be &lt;em&gt;added&lt;/em&gt; if they&#039;re missing. I wonder if the paging URL without a trailing slash isn&#039;t being recognized by WP? If that lead goes nowhere, maybe check the WP forums. Good luck!</description>
		<content:encoded><![CDATA[<p>Ryan, glad you like the site! As to your issue, hard to tell what&#8217;s going on from the outside. However, it seems clear that the issue is probably nothing to do with this pagination code. The URL <a href="http://abletonlife.com/news/page/2">http://abletonlife.com/news/page/2</a> is showing the same as <a href="http://abletonlife.com/news">http://abletonlife.com/news</a>, so WP&#8217;s paging itself isn&#8217;t working. The only thing I can spot as a possible starting point is that there&#8217;s no trailing slash on the URLs. If one is added, it gets removed. I can&#8217;t remember whether it&#8217;s a server-level thing or a WP thing, but in my experience the normal behaviour is for trailing slashes to be <em>added</em> if they&#8217;re missing. I wonder if the paging URL without a trailing slash isn&#8217;t being recognized by WP? If that lead goes nowhere, maybe check the WP forums. Good luck!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://sltaylor.co.uk/blog/better-wordpress-pagination/#comment-6503</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Tue, 11 May 2010 07:14:20 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=149#comment-6503</guid>
		<description>Hey Steve! First of all, great site. 

Secondly, I have quick question:

If you notice on my &quot;News&quot;  page (http://abletonlife.com/news), when you click on the &quot;2&quot; at the bottom of the page, it loops back to the same page. I know I have more than 10 posts, so why isn&#039;t it showing the other ones like on the home page? 

Any help is appreciated! Thanks!

- Ryan</description>
		<content:encoded><![CDATA[<p>Hey Steve! First of all, great site. </p>
<p>Secondly, I have quick question:</p>
<p>If you notice on my &#8220;News&#8221;  page (<a href="http://abletonlife.com/news">http://abletonlife.com/news</a>), when you click on the &#8220;2&#8243; at the bottom of the page, it loops back to the same page. I know I have more than 10 posts, so why isn&#8217;t it showing the other ones like on the home page? </p>
<p>Any help is appreciated! Thanks!</p>
<p>- Ryan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Taylor</title>
		<link>http://sltaylor.co.uk/blog/better-wordpress-pagination/#comment-4974</link>
		<dc:creator>Steve Taylor</dc:creator>
		<pubDate>Mon, 22 Mar 2010 21:54:19 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=149#comment-4974</guid>
		<description>Thanks Peter! (BTW, do use pastebin.ca for snippets, saves on formatting issues.)</description>
		<content:encoded><![CDATA[<p>Thanks Peter! (BTW, do use pastebin.ca for snippets, saves on formatting issues.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://sltaylor.co.uk/blog/better-wordpress-pagination/#comment-4973</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Mon, 22 Mar 2010 21:48:52 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=149#comment-4973</guid>
		<description>ayman (9th January 2010) and Steve, to limit the number of pages displayed change

&lt;code&gt;if ( $i == $page ) { 
                echo &#039;&#039;.$i.&#039;&#039;; 
            } else { 
                echo &#039;&lt;a href=&quot;&#039;.$baseURL.&#039;page/&#039;.$i.&#039;/&#039;.$qs.&#039;&quot;&gt;&#039;.$i.&#039;&lt;/a&gt;&#039;;&lt;/code&gt;

to

&lt;code&gt;if ( $i == $page ) {
				echo &#039;&#039;.$i.&#039;&#039;;
			} elseif ($i &lt; 10) {
				echo &#039;&lt;a href=&quot;&#039;.$baseURL.&#039;page/&#039;.$i.&#039;/&#039;.$qs.&#039;&quot;&gt;&#039;.$i.&#039;&lt;/a&gt;&#039;;&lt;/code&gt;

P.s thanks steve you rock!</description>
		<content:encoded><![CDATA[<p>ayman (9th January 2010) and Steve, to limit the number of pages displayed change</p>
<p><code>if ( $i == $page ) {<br />
                echo ''.$i.'';<br />
            } else {<br />
                echo '&lt;a href="'.$baseURL.'page/'.$i.'/'.$qs.'"&gt;'.$i.'&lt;/a&gt;';</code></p>
<p>to</p>
<p><code>if ( $i == $page ) {<br />
				echo ''.$i.'';<br />
			} elseif ($i &lt; 10) {<br />
				echo &#039;&lt;a href="'.$baseURL.'page/'.$i.'/'.$qs.'"&gt;'.$i.'&lt;/a&gt;';</code></p>
<p>P.s thanks steve you rock!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Wilson</title>
		<link>http://sltaylor.co.uk/blog/better-wordpress-pagination/#comment-4594</link>
		<dc:creator>Steven Wilson</dc:creator>
		<pubDate>Thu, 04 Mar 2010 17:46:21 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=149#comment-4594</guid>
		<description>Work a treat !! .. Thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Work a treat !! .. Thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Taylor</title>
		<link>http://sltaylor.co.uk/blog/better-wordpress-pagination/#comment-4348</link>
		<dc:creator>Steve Taylor</dc:creator>
		<pubDate>Sun, 21 Feb 2010 02:53:50 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=149#comment-4348</guid>
		<description>Pete, could you give a URL to an example where this is happening? The only thing I can guess at from your sample URL is that perhaps the script doesn&#039;t work properly without &quot;pretty &lt;a href=&quot;http://codex.wordpress.org/Using_Permalinks&quot;&gt;permalinks&lt;/a&gt;&quot;. I&#039;m not sure why you wouldn&#039;t have a pretty permalink structure, but if you&#039;re stuck with &quot;ugly&quot; query string-based links---well, it should be easy to adapt. Do post your solution if you need to add anything.</description>
		<content:encoded><![CDATA[<p>Pete, could you give a URL to an example where this is happening? The only thing I can guess at from your sample URL is that perhaps the script doesn&#8217;t work properly without &#8220;pretty <a href="http://codex.wordpress.org/Using_Permalinks">permalinks</a>&#8220;. I&#8217;m not sure why you wouldn&#8217;t have a pretty permalink structure, but if you&#8217;re stuck with &#8220;ugly&#8221; query string-based links&#8212;well, it should be easy to adapt. Do post your solution if you need to add anything.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://sltaylor.co.uk/blog/better-wordpress-pagination/#comment-4339</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Sat, 20 Feb 2010 21:14:58 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=149#comment-4339</guid>
		<description>Am I the only one that&#039;s get recursive querystring addition when implementing this pagination script?

I have had to alter the make up of the href a little, but the bulk of the code is still the same.

I could really do with a little bit of help with this one.

Eg: http://website/?s=lorem&amp;paged=2&amp;paged=1&amp;paged=3 this just keeps getting longer and longer dependent on how many links are clicked. Am I just going to have to write a string manipulation function to sort this out?</description>
		<content:encoded><![CDATA[<p>Am I the only one that&#8217;s get recursive querystring addition when implementing this pagination script?</p>
<p>I have had to alter the make up of the href a little, but the bulk of the code is still the same.</p>
<p>I could really do with a little bit of help with this one.</p>
<p>Eg: <a href="http://website/?s=lorem&amp;paged=2&amp;paged=1&amp;paged=3">http://website/?s=lorem&amp;paged=2&amp;paged=1&amp;paged=3</a> this just keeps getting longer and longer dependent on how many links are clicked. Am I just going to have to write a string manipulation function to sort this out?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://sltaylor.co.uk/blog/better-wordpress-pagination/#comment-4333</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Sat, 20 Feb 2010 13:09:15 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=149#comment-4333</guid>
		<description>Works brilliantly. So simple.</description>
		<content:encoded><![CDATA[<p>Works brilliantly. So simple.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
