<?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: WordPress: Fix Category Exclusions in next_post_link() / previous_post_link()</title>
	<atom:link href="http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/feed/" rel="self" type="application/rss+xml" />
	<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/</link>
	<description>go. figure. «</description>
	<lastBuildDate>Fri, 05 Mar 2010 20:57:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Andy</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-39262</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Wed, 13 Jan 2010 10:36:08 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-39262</guid>
		<description>Had some problems implementing the Previous_post_link and next_post_link exclusions (using Wordpress 2.8.6), until stumbling upon Steve M&#039;s syntax above - now works fine - thanks!</description>
		<content:encoded><![CDATA[<p>Had some problems implementing the Previous_post_link and next_post_link exclusions (using Wordpress 2.8.6), until stumbling upon Steve M&#8217;s syntax above &#8211; now works fine &#8211; thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve M</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-36455</link>
		<dc:creator>Steve M</dc:creator>
		<pubDate>Mon, 28 Jan 2008 06:20:04 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-36455</guid>
		<description>Personally, I had a whole array of problems with this and I only had 4 categories.  The solution is still dodgy in Wordpress 2.3, but I got it working perfectly by:

&lt;code&gt;
&lt;?php next_post_link($format=&#039;%link &#187;&#039;, $link=&#039;%title&#039;, $in_same_cat
= false, $excluded_categories = &#039;X and X and X&#039; ); ?&gt;
&lt;/code&gt;

It&#039;s explained in better detail on the wordpress codex &lt;a href=&quot;http://codex.wordpress.org/Template_Tags/next_post_link&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;

As you will no doubt notice, the third parameter &#039;$in_same_cat&#039; is bogus and doesn&#039;t work if set to &#039;true.&#039;</description>
		<content:encoded><![CDATA[<p>Personally, I had a whole array of problems with this and I only had 4 categories.  The solution is still dodgy in Wordpress 2.3, but I got it working perfectly by:</p>
<p><code><br />
< ?php next_post_link($format='%link &raquo;', $link='%title', $in_same_cat<br />
= false, $excluded_categories = 'X and X and X' ); ?><br />
</code></p>
<p>It&#8217;s explained in better detail on the wordpress codex <a href="http://codex.wordpress.org/Template_Tags/next_post_link" rel="nofollow">here</a></p>
<p>As you will no doubt notice, the third parameter &#8216;$in_same_cat&#8217; is bogus and doesn&#8217;t work if set to &#8216;true.&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-35723</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Sat, 21 Jul 2007 09:16:37 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-35723</guid>
		<description>Thanks for this, Stewart. The problem subsists in 2.2.1. Your fix works for me but it&#039;s now line numbers 339 and 376 that need to be changed.</description>
		<content:encoded><![CDATA[<p>Thanks for this, Stewart. The problem subsists in 2.2.1. Your fix works for me but it&#8217;s now line numbers 339 and 376 that need to be changed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stewart Johnson</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-32606</link>
		<dc:creator>Stewart Johnson</dc:creator>
		<pubDate>Sun, 20 May 2007 16:12:37 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-32606</guid>
		<description>Sorry to spam you. :&quot;&gt;

I figured out how to submit bug reports: 

http://trac.wordpress.org/ticket/4304</description>
		<content:encoded><![CDATA[<p>Sorry to spam you. <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_blush.gif' alt='&#58;&#34;&#62;' class='wp-smiley' width='18' height='18' title='&#58;&#34;&#62;' /></p>
<p>I figured out how to submit bug reports: </p>
<p><a href="http://trac.wordpress.org/ticket/4304" rel="nofollow">http://trac.wordpress.org/ticket/4304</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stewart Johnson</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-32602</link>
		<dc:creator>Stewart Johnson</dc:creator>
		<pubDate>Sun, 20 May 2007 15:57:49 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-32602</guid>
		<description>Wait, I just figured out what the error is. For WP 2.1.3 the code in get_next_post and get_previous_post hasn&#039;t been tested, but most of the mistakes are harmless (for example $sql_exclude_cats is declared and never used).

There&#039;s a one line fix for WP2.1.3 to get this code to work. In both functions, this line (lines 294 and 331 in link-template.php):

&lt;code&gt;$sql_cat_ids = &quot; OR pc.category_ID = &#039;$category&#039;&quot;;&lt;/code&gt;

should be changed to 

&lt;code&gt;$sql_cat_ids .= &quot; OR pc.category_ID = &#039;$category&#039;&quot;;&lt;/code&gt;

(changed = to .=)

Where do I submit WP bug reports &amp; fixes. Can I submit a patch myself?</description>
		<content:encoded><![CDATA[<p>Wait, I just figured out what the error is. For WP 2.1.3 the code in get_next_post and get_previous_post hasn&#8217;t been tested, but most of the mistakes are harmless (for example $sql_exclude_cats is declared and never used).</p>
<p>There&#8217;s a one line fix for WP2.1.3 to get this code to work. In both functions, this line (lines 294 and 331 in link-template.php):</p>
<p><code>$sql_cat_ids = " OR pc.category_ID = '$category'";</code></p>
<p>should be changed to </p>
<p><code>$sql_cat_ids .= " OR pc.category_ID = '$category'";</code></p>
<p>(changed = to .=)</p>
<p>Where do I submit WP bug reports &amp; fixes. Can I submit a patch myself?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stewart Johnson</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-32597</link>
		<dc:creator>Stewart Johnson</dc:creator>
		<pubDate>Sun, 20 May 2007 15:47:44 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-32597</guid>
		<description>I&#039;m trying to get this feature (the fourth parameter to get_next_post) to work in WP 2.1.3 and it still seems to be broken. I looked at the WP code (now in wp-includes/link-template.php) and they&#039;ve changed it, but it still doesn&#039;t work for me.

If I use 

get_next_post(&#039;%link&#039;, &#039;%title&#039;, FALSE, &#039;1 and 2&#039;);

then posts in category 2 are ignored, but not those in 1. It&#039;s quite annoying!

I looked at the code, but at cursory inspection I can&#039;t see what&#039;s wrong with it. Have you managed to get this feature to work in v2.1.3?</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying to get this feature (the fourth parameter to get_next_post) to work in WP 2.1.3 and it still seems to be broken. I looked at the WP code (now in wp-includes/link-template.php) and they&#8217;ve changed it, but it still doesn&#8217;t work for me.</p>
<p>If I use </p>
<p>get_next_post(&#8216;%link&#8217;, &#8216;%title&#8217;, FALSE, &#8216;1 and 2&#8242;);</p>
<p>then posts in category 2 are ignored, but not those in 1. It&#8217;s quite annoying!</p>
<p>I looked at the code, but at cursory inspection I can&#8217;t see what&#8217;s wrong with it. Have you managed to get this feature to work in v2.1.3?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-18007</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Thu, 25 Jan 2007 18:41:23 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-18007</guid>
		<description>Excellent!  I&#039;m happy to [finally!] be obsolete.  :)</description>
		<content:encoded><![CDATA[<p>Excellent!  I&#8217;m happy to [finally!] be obsolete.  <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_smiley.gif' alt='&#58;&#41;' class='wp-smiley' width='18' height='18' title='&#58;&#41;' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-18004</link>
		<dc:creator>Oliver</dc:creator>
		<pubDate>Thu, 25 Jan 2007 17:40:31 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-18004</guid>
		<description>I just gave it a shot and it does work fine!! So while your hack helped me out for a long time (again thanks for providing it!) with 2.1 it became obsolete. ;)</description>
		<content:encoded><![CDATA[<p>I just gave it a shot and it does work fine!! So while your hack helped me out for a long time (again thanks for providing it!) with 2.1 it became obsolete. <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_wink.gif' alt='&#59;&#41;' class='wp-smiley' width='18' height='18' title='&#59;&#41;' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-17995</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Thu, 25 Jan 2007 16:13:56 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-17995</guid>
		<description>good question.  i&#039;m not sure yet; i&#039;m waiting for the bugs to be shaken out before i switch to the 2.1 branch.  (but maybe someone else on this thread has installed 2.1 and can tell us?)</description>
		<content:encoded><![CDATA[<p>good question.  i&#8217;m not sure yet; i&#8217;m waiting for the bugs to be shaken out before i switch to the 2.1 branch.  (but maybe someone else on this thread has installed 2.1 and can tell us?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-17523</link>
		<dc:creator>Oliver</dc:creator>
		<pubDate>Mon, 22 Jan 2007 11:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-17523</guid>
		<description>Hi Ron,

Thanks for the &quot;hack&quot; - it really works like a charm and has been ever since I implemented the Sideblog plugin on top of WP2.03. Would you know whether the faulty core code has been fixed in WP2.1?

Thanks, 
Oliver</description>
		<content:encoded><![CDATA[<p>Hi Ron,</p>
<p>Thanks for the &#8220;hack&#8221; &#8211; it really works like a charm and has been ever since I implemented the Sideblog plugin on top of WP2.03. Would you know whether the faulty core code has been fixed in WP2.1?</p>
<p>Thanks,<br />
Oliver</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brance</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-6698</link>
		<dc:creator>Brance</dc:creator>
		<pubDate>Tue, 26 Sep 2006 13:52:05 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-6698</guid>
		<description>Ron,

Thanks for this fix man. It was just what I was looking for.

Brance</description>
		<content:encoded><![CDATA[<p>Ron,</p>
<p>Thanks for this fix man. It was just what I was looking for.</p>
<p>Brance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alif</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-5970</link>
		<dc:creator>Alif</dc:creator>
		<pubDate>Sat, 26 Aug 2006 01:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-5970</guid>
		<description>This is not directly related to the post, but I wonder if you have any idea:

Whenever I post PHP code (all properly escaped into HTML entities) within a post in Wordpress 2.0.4 I get Error 403 on post.php!

Although it is my first time, it seems to me that people have been posting PHP code snippets forever in Wordpress. Do you have any idea why this might be happening?</description>
		<content:encoded><![CDATA[<p>This is not directly related to the post, but I wonder if you have any idea:</p>
<p>Whenever I post PHP code (all properly escaped into HTML entities) within a post in Wordpress 2.0.4 I get Error 403 on post.php!</p>
<p>Although it is my first time, it seems to me that people have been posting PHP code snippets forever in Wordpress. Do you have any idea why this might be happening?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sofastar &#187; Blog Archive &#187; Exclude Categories</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-5909</link>
		<dc:creator>sofastar &#187; Blog Archive &#187; Exclude Categories</dc:creator>
		<pubDate>Sun, 20 Aug 2006 00:28:06 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-5909</guid>
		<description>[...]   You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your ownsite. [...]</description>
		<content:encoded><![CDATA[<p>[...]   You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your ownsite. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sofastar</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-5908</link>
		<dc:creator>sofastar</dc:creator>
		<pubDate>Sun, 20 Aug 2006 00:15:02 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-5908</guid>
		<description>Thanks a lot! I&#039;m using Wordpress 2.0.4 an this issui still seems not to be fixed. Applied your hack just by copy &amp; past -ing it, and everything works great! Now I&#039;ll have a look at the code and try to find out what you did actuall :-) kind regards, sofastar</description>
		<content:encoded><![CDATA[<p>Thanks a lot! I&#8217;m using Wordpress 2.0.4 an this issui still seems not to be fixed. Applied your hack just by copy &amp; past -ing it, and everything works great! Now I&#8217;ll have a look at the code and try to find out what you did actuall <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_smiley.gif' alt='&#58;&#45;&#41;' class='wp-smiley' width='18' height='18' title='&#58;&#45;&#41;' /> kind regards, sofastar</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Weingart</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-511</link>
		<dc:creator>David Weingart</dc:creator>
		<pubDate>Fri, 03 Mar 2006 20:26:53 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-511</guid>
		<description>Just another note of thanks - this fixed a big problem I was having with a custom WordPress setup. I&#039;m running 2.0.1

It looks like this bug has been fixed for the next release, so it&#039;s safe to apply your hack without upgrade worries.</description>
		<content:encoded><![CDATA[<p>Just another note of thanks &#8211; this fixed a big problem I was having with a custom WordPress setup. I&#8217;m running 2.0.1</p>
<p>It looks like this bug has been fixed for the next release, so it&#8217;s safe to apply your hack without upgrade worries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-506</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Wed, 01 Mar 2006 22:23:05 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-506</guid>
		<description>hi todd,

i&#039;m glad you found this useful.  i suspect that the next WP release will (finally!) fix this problem.

i&#039;m not really familiar with the trac solution, but it looks to me like it&#039;s meant to be used with the &quot;patch&quot; command to automatically apply the changes to your files.</description>
		<content:encoded><![CDATA[<p>hi todd,</p>
<p>i&#8217;m glad you found this useful.  i suspect that the next WP release will (finally!) fix this problem.</p>
<p>i&#8217;m not really familiar with the trac solution, but it looks to me like it&#8217;s meant to be used with the &#8220;patch&#8221; command to automatically apply the changes to your files.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Todd</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-505</link>
		<dc:creator>Todd</dc:creator>
		<pubDate>Wed, 01 Mar 2006 07:45:48 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-505</guid>
		<description>This works in 2.0.1, also. Keep in mind what a4g pointed out up there; make sure that &lt;code&gt;post_id&lt;/code&gt; is on one line, with no line break in between them, and this should work like so:
&lt;code&gt;
next_post_link(&#039;%link&#039;, &#039;%title&#039;, false, 2)
&lt;/code&gt;
Change that number to the category ID of whatever category (or categories?) you want to exclude. 

Thanks for this. It&#039;s much easier to follow than the &lt;a href=&quot;http://trac.wordpress.org/attachment/ticket/2215/2215.2.diff&quot; rel=&quot;nofollow&quot;&gt;current trac solution&lt;/a&gt;, which only suggests changes to &lt;code&gt;get_next_post&lt;/code&gt; and &lt;code&gt;next_post_link&lt;/code&gt;. Did I misunderstand that trac file? I like that it tells me which lines to delete and include, but this solution just seems to make more sense because we alter both the next and previous functions.</description>
		<content:encoded><![CDATA[<p>This works in 2.0.1, also. Keep in mind what a4g pointed out up there; make sure that <code>post_id</code> is on one line, with no line break in between them, and this should work like so:<br />
<code><br />
next_post_link('%link', '%title', false, 2)<br />
</code><br />
Change that number to the category ID of whatever category (or categories?) you want to exclude. </p>
<p>Thanks for this. It&#8217;s much easier to follow than the <a href="http://trac.wordpress.org/attachment/ticket/2215/2215.2.diff" rel="nofollow">current trac solution</a>, which only suggests changes to <code>get_next_post</code> and <code>next_post_link</code>. Did I misunderstand that trac file? I like that it tells me which lines to delete and include, but this solution just seems to make more sense because we alter both the next and previous functions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-462</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Thu, 02 Feb 2006 05:47:17 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-462</guid>
		<description>thanks for the info--i&#039;m glad to know it works in 2.0!  (i haven&#039;t yet upgraded from 1.5.1.)

btw, it looks like someone else noticed that it&#039;s still broken in 2.0 (and fixed it):

http://wordpress.org/support/topic/44031?replies=11

so, pretty soon, my hack will become obsolete.</description>
		<content:encoded><![CDATA[<p>thanks for the info&#8211;i&#8217;m glad to know it works in 2.0!  (i haven&#8217;t yet upgraded from 1.5.1.)</p>
<p>btw, it looks like someone else noticed that it&#8217;s still broken in 2.0 (and fixed it):</p>
<p><a href="http://wordpress.org/support/topic/44031?replies=11" rel="nofollow">http://wordpress.org/support/topic/44031?replies=11</a></p>
<p>so, pretty soon, my hack will become obsolete.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arthur</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-461</link>
		<dc:creator>Arthur</dc:creator>
		<pubDate>Wed, 01 Feb 2006 22:09:38 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-461</guid>
		<description>Whoops! Nevermind!!! :)

Your fix still works with version 2.0, thanks again. :)</description>
		<content:encoded><![CDATA[<p>Whoops! Nevermind!!! <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_smiley.gif' alt='&#58;&#41;' class='wp-smiley' width='18' height='18' title='&#58;&#41;' /></p>
<p>Your fix still works with version 2.0, thanks again. <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_smiley.gif' alt='&#58;&#41;' class='wp-smiley' width='18' height='18' title='&#58;&#41;' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arthur</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-460</link>
		<dc:creator>Arthur</dc:creator>
		<pubDate>Wed, 01 Feb 2006 20:51:35 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-460</guid>
		<description>Sigh...Ron, I don&#039;t suppose you would want to take a crack at upgrading this to work in WP 2.0, where the cat params still don&#039;t seem to work?

-- Your ever greatful WordPress fan, Arthur.</description>
		<content:encoded><![CDATA[<p>Sigh&#8230;Ron, I don&#8217;t suppose you would want to take a crack at upgrading this to work in WP 2.0, where the cat params still don&#8217;t seem to work?</p>
<p>&#8211; Your ever greatful WordPress fan, Arthur.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John V</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-350</link>
		<dc:creator>John V</dc:creator>
		<pubDate>Wed, 23 Nov 2005 12:47:52 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-350</guid>
		<description>the exclusion wasn&#039;t working until I applied your hack. I was just mentioning that your hack seems to fix the old deprecated tags as well as the new ones.</description>
		<content:encoded><![CDATA[<p>the exclusion wasn&#8217;t working until I applied your hack. I was just mentioning that your hack seems to fix the old deprecated tags as well as the new ones.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-349</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Wed, 23 Nov 2005 04:46:30 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-349</guid>
		<description>thanks john; good to know.

to restate what i think you said: you found that the deprecated functions &lt;code&gt;next_post()&lt;/code&gt; and &lt;code&gt;previous_post()&lt;/code&gt; both &lt;em&gt;do&lt;/em&gt; correctly exclude categories, so if someone is using those functions then they need not apply the hack i outlined above.  (and just so people know, it looks from your blog like you&#039;re talking about WP version 1.5.2 here.)

this info will surely help some people out, but i would also advise some caution.  if the codex states that the parameter is &quot;archaic,&quot; then its behaviour--across future releases--is tenuous at best (and undefined at worst).

in any case, i hope this is fixed in 1.6.  i&#039;ll be happy to retire this blog entry. :)</description>
		<content:encoded><![CDATA[<p>thanks john; good to know.</p>
<p>to restate what i think you said: you found that the deprecated functions <code>next_post()</code> and <code>previous_post()</code> both <em>do</em> correctly exclude categories, so if someone is using those functions then they need not apply the hack i outlined above.  (and just so people know, it looks from your blog like you&#8217;re talking about WP version 1.5.2 here.)</p>
<p>this info will surely help some people out, but i would also advise some caution.  if the codex states that the parameter is &#8220;archaic,&#8221; then its behaviour&#8211;across future releases&#8211;is tenuous at best (and undefined at worst).</p>
<p>in any case, i hope this is fixed in 1.6.  i&#8217;ll be happy to retire this blog entry. <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_smiley.gif' alt='&#58;&#41;' class='wp-smiley' width='18' height='18' title='&#58;&#41;' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John V</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-348</link>
		<dc:creator>John V</dc:creator>
		<pubDate>Tue, 22 Nov 2005 21:54:59 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-348</guid>
		<description>thanks! I did this fix so that my single page &quot;next&quot; and &quot;previous&quot; link wouldn&#039;t grab stuff from my events calendar... I&#039;m using a modified kubrick theme which calls the &quot;deprecated&quot; previous_post and next_post tags... I was all set to go replace them with the new tags, but a quick test to make sure my application of your fix didn&#039;t break anything revealed that the exclusion built into those tags now works, regardless of the codex statement that it&#039;s an &quot;archaic parameter ...  does not function in 1.5.&quot;</description>
		<content:encoded><![CDATA[<p>thanks! I did this fix so that my single page &#8220;next&#8221; and &#8220;previous&#8221; link wouldn&#8217;t grab stuff from my events calendar&#8230; I&#8217;m using a modified kubrick theme which calls the &#8220;deprecated&#8221; previous_post and next_post tags&#8230; I was all set to go replace them with the new tags, but a quick test to make sure my application of your fix didn&#8217;t break anything revealed that the exclusion built into those tags now works, regardless of the codex statement that it&#8217;s an &#8220;archaic parameter &#8230;  does not function in 1.5.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-345</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Tue, 22 Nov 2005 03:14:29 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-345</guid>
		<description>excellent--glad to hear it!! (the part about your code working--not the part about the zionist conspiracy. :D )

p.s., i&#039;m going to add a note beneath the code snippet to help people avoid the copy&amp;paste trouble you just had.
</description>
		<content:encoded><![CDATA[<p>excellent&#8211;glad to hear it!! (the part about your code working&#8211;not the part about the zionist conspiracy. <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_bigsmile.gif' alt='&#58;&#68;' class='wp-smiley' width='18' height='18' title='&#58;&#68;' /> )</p>
<p>p.s., i&#8217;m going to add a note beneath the code snippet to help people avoid the copy&#038;paste trouble you just had.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: a4g</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-344</link>
		<dc:creator>a4g</dc:creator>
		<pubDate>Tue, 22 Nov 2005 03:12:10 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-344</guid>
		<description>Working!!!!

Okay, now I&#039;ll heap all the richly deserved praise upon you, Ron.  AWESOME!

True, my &quot;=&quot; -&gt; &quot;.=&quot; was pure desperation -- but I did manage to hunt down the code problem:

when cutting &amp; pasting from the above box, the 

&lt;code&gt;$sql_exclude_cats .= &#039;,&#039; . intval($excluded_post_rows[$i]-&gt;post_
id);&lt;/code&gt;

(which is forced onto two lines) inserts a CRLF between &quot;_&quot; and &quot;id&quot;, which understandably [m]ucks up the works.  By backspacing the &quot;id&quot; back onto the &quot;post_&quot;, everything started working hunky-dory.

As to the hebrew error message, I&#039;ve always been disgusted by accusations of some shadowy international zionist conspiracy, but now I&#039;m not so sure... ;-).

Thanks again, Ron.</description>
		<content:encoded><![CDATA[<p>Working!!!!</p>
<p>Okay, now I&#8217;ll heap all the richly deserved praise upon you, Ron.  AWESOME!</p>
<p>True, my &#8220;=&#8221; -&gt; &#8220;.=&#8221; was pure desperation &#8212; but I did manage to hunt down the code problem:</p>
<p>when cutting &amp; pasting from the above box, the </p>
<p><code>$sql_exclude_cats .= ',' . intval($excluded_post_rows[$i]-&gt;post_<br />
id);</code></p>
<p>(which is forced onto two lines) inserts a CRLF between &#8220;_&#8221; and &#8220;id&#8221;, which understandably [m]ucks up the works.  By backspacing the &#8220;id&#8221; back onto the &#8220;post_&#8221;, everything started working hunky-dory.</p>
<p>As to the hebrew error message, I&#8217;ve always been disgusted by accusations of some shadowy international zionist conspiracy, but now I&#8217;m not so sure&#8230; <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_wink.gif' alt='&#59;&#45;&#41;' class='wp-smiley' width='18' height='18' title='&#59;&#45;&#41;' />.</p>
<p>Thanks again, Ron.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-343</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Tue, 22 Nov 2005 01:59:57 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-343</guid>
		<description>a4g,

i&#039;ll try to help... hopefully we can get it working for you.

a few things:

1. oops, sorry about the &quot;&#039;s.  i&#039;ve edited the entry and fixed them above.  (by way of explanation, they were there because of a code-formatting plug-in that i installed &lt;em&gt;after&lt;/em&gt; i wrote this entry.)

2. i think your change of &quot;=&quot; to &quot;.=&quot; was an error (albeit a harmless one).  it should in fact be a straight assignment there, not a concatenation.

would you mind trying one more time to copy &amp; paste the (fixed) code into your installation from scratch?

if you still see the problem, write back and include how you&#039;re calling next_post_link().  also, let me know if it doesn&#039;t work for both next_post_link and prev_post_link, since there&#039;s the outside possibility (because of all the manual editing required) that it ends up working for one of them but not the other.

(and if the problem is solved, then let me know that too. :) )

p.s., i find it odd that your php installation is giving you error messages in hebrew (PAAMAYIM NEKUDOTAYIM). :-/</description>
		<content:encoded><![CDATA[<p>a4g,</p>
<p>i&#8217;ll try to help&#8230; hopefully we can get it working for you.</p>
<p>a few things:</p>
<p>1. oops, sorry about the &amp;quot;&#8217;s.  i&#8217;ve edited the entry and fixed them above.  (by way of explanation, they were there because of a code-formatting plug-in that i installed <em>after</em> i wrote this entry.)</p>
<p>2. i think your change of &#8220;=&#8221; to &#8220;.=&#8221; was an error (albeit a harmless one).  it should in fact be a straight assignment there, not a concatenation.</p>
<p>would you mind trying one more time to copy &amp; paste the (fixed) code into your installation from scratch?</p>
<p>if you still see the problem, write back and include how you&#8217;re calling next_post_link().  also, let me know if it doesn&#8217;t work for both next_post_link and prev_post_link, since there&#8217;s the outside possibility (because of all the manual editing required) that it ends up working for one of them but not the other.</p>
<p>(and if the problem is solved, then let me know that too. <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_smiley.gif' alt='&#58;&#41;' class='wp-smiley' width='18' height='18' title='&#58;&#41;' /> )</p>
<p>p.s., i find it odd that your php installation is giving you error messages in hebrew (PAAMAYIM NEKUDOTAYIM). <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_question.gif' alt='&#58;&#45;&#47;' class='wp-smiley' width='18' height='18' title='&#58;&#45;&#47;' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: a4g</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-342</link>
		<dc:creator>a4g</dc:creator>
		<pubDate>Tue, 22 Nov 2005 01:22:40 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-342</guid>
		<description>Ron,

Can&#039;t get this to work.  I&#039;ve tried the version above and the one on the wordpress forum -- I get this error:  


Parse error: parse error, unexpected &#039;;&#039;, expecting T_PAAMAYIM_NEKUDOTAYIM or &#039;(&#039; in /home/jump1932/public_html/wp/wp-includes/template-functions-links.php on line 260

After replacing all the &amp; quot; and replacing 

&lt;code&gt;$sql_exclude_cats =
                &#039; AND ID NOT IN (&#039;&lt;/code&gt;

with

&lt;code&gt;$sql_exclude_cats .=
                &#039; AND ID NOT IN (&#039;&lt;/code&gt;

I got the site to load without error, but there still seems to be no functionality.  I&#039;m trying to hide my category &quot;9&quot;.  Note: I did put the appropriate declarations in the next_post_link().

Any ideas?</description>
		<content:encoded><![CDATA[<p>Ron,</p>
<p>Can&#8217;t get this to work.  I&#8217;ve tried the version above and the one on the wordpress forum &#8212; I get this error:  </p>
<p>Parse error: parse error, unexpected &#8216;;&#8217;, expecting T_PAAMAYIM_NEKUDOTAYIM or &#8216;(&#8216; in /home/jump1932/public_html/wp/wp-includes/template-functions-links.php on line 260</p>
<p>After replacing all the &amp; quot; and replacing </p>
<p><code>$sql_exclude_cats =<br />
                ' AND ID NOT IN ('</code></p>
<p>with</p>
<p><code>$sql_exclude_cats .=<br />
                ' AND ID NOT IN ('</code></p>
<p>I got the site to load without error, but there still seems to be no functionality.  I&#8217;m trying to hide my category &#8220;9&#8243;.  Note: I did put the appropriate declarations in the next_post_link().</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sara</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-263</link>
		<dc:creator>Sara</dc:creator>
		<pubDate>Wed, 02 Nov 2005 16:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-263</guid>
		<description>meow. =^..^=</description>
		<content:encoded><![CDATA[<p>meow. =^..^=</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-262</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Wed, 02 Nov 2005 16:12:03 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-262</guid>
		<description>&lt;blockquote&gt;Sara said:

Why does the sql exclude cats? I think that’s just plain mean.&lt;/blockquote&gt;

even though i laughed out loud at your comment, you&#039;re still in trouble.  (along with that &quot;Ferritis&quot; character.)</description>
		<content:encoded><![CDATA[<blockquote><p>Sara said:</p>
<p>Why does the sql exclude cats? I think that’s just plain mean.</p></blockquote>
<p>even though i laughed out loud at your comment, you&#8217;re still in trouble.  (along with that &#8220;Ferritis&#8221; character.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-261</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Wed, 02 Nov 2005 16:09:28 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-261</guid>
		<description>arthur,

thanks for the comment--i&#039;m so happy that this was actually helpful to someone!  (and now maybe my wisecracking, non-techie friends will keep their traps shut :-B ).

and extra thanks for pointing out the cut/paste problem!  i&#039;ve fixed the code snippet.  (though i had to settle for inferior double quotes since i couldn&#039;t quickly figure out how to escape the php code in WordPress. :) )

enjoy!</description>
		<content:encoded><![CDATA[<p>arthur,</p>
<p>thanks for the comment&#8211;i&#8217;m so happy that this was actually helpful to someone!  (and now maybe my wisecracking, non-techie friends will keep their traps shut <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_glasses.gif' alt='&#58;&#45;&#66;' class='wp-smiley' width='24' height='18' title='&#58;&#45;&#66;' /> ).</p>
<p>and extra thanks for pointing out the cut/paste problem!  i&#8217;ve fixed the code snippet.  (though i had to settle for inferior double quotes since i couldn&#8217;t quickly figure out how to escape the php code in WordPress. <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_smiley.gif' alt='&#58;&#41;' class='wp-smiley' width='18' height='18' title='&#58;&#41;' /> )</p>
<p>enjoy!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arthur</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-260</link>
		<dc:creator>Arthur</dc:creator>
		<pubDate>Wed, 02 Nov 2005 15:54:35 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-260</guid>
		<description>THANK YOU!!!

Ron, thank you so much for this solution! I just changed my template-function-links.php file, and it works perfectly! I&#039;ve been looking for a solution for this for several weeks now, and I had just about given up when I saw your posting at wordpress.org/support. This is exactly what I need, and I very much appreciate your implementing it. :)

One point about the code in html that you have posted above: the last line that reads $sql_exclude_cats .= ‘)’; actually uses curly single quotes, ie: the html code shows the entities &#8216; and &#8217; which may confuse those who are cutting and pasting from this page.

Ron, thank you again. I&#039;m an HTML/JavaScript sort of guy who is completely lost in the world of PHP and SQL. Please let me know if there is anything I can ever do for you! :)

-- Arthur</description>
		<content:encoded><![CDATA[<p>THANK YOU!!!</p>
<p>Ron, thank you so much for this solution! I just changed my template-function-links.php file, and it works perfectly! I&#8217;ve been looking for a solution for this for several weeks now, and I had just about given up when I saw your posting at wordpress.org/support. This is exactly what I need, and I very much appreciate your implementing it. <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_smiley.gif' alt='&#58;&#41;' class='wp-smiley' width='18' height='18' title='&#58;&#41;' /></p>
<p>One point about the code in html that you have posted above: the last line that reads $sql_exclude_cats .= ‘)’; actually uses curly single quotes, ie: the html code shows the entities &#8216; and &#8217; which may confuse those who are cutting and pasting from this page.</p>
<p>Ron, thank you again. I&#8217;m an HTML/JavaScript sort of guy who is completely lost in the world of PHP and SQL. Please let me know if there is anything I can ever do for you! <img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_smiley.gif' alt='&#58;&#41;' class='wp-smiley' width='18' height='18' title='&#58;&#41;' /></p>
<p>&#8211; Arthur</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sara</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-259</link>
		<dc:creator>Sara</dc:creator>
		<pubDate>Wed, 02 Nov 2005 15:15:10 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-259</guid>
		<description>Why does the sql exclude cats? I think that&#039;s just plain mean.</description>
		<content:encoded><![CDATA[<p>Why does the sql exclude cats? I think that&#8217;s just plain mean.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-256</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Wed, 02 Nov 2005 04:43:06 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-256</guid>
		<description>X-( why you little...</description>
		<content:encoded><![CDATA[<p><img src='http://ronrothman.com/public/leftbraned/smilies/yahoo_angry.gif' alt='&#88;&#45;&#40;' class='wp-smiley' width='34' height='18' title='&#88;&#45;&#40;' /> why you little&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: emanuel ferritis</title>
		<link>http://ronrothman.com/public/leftbraned/wordpress-fix-category-exclusions-in-next_post_linkprevious_post_link/comment-page-1/#comment-255</link>
		<dc:creator>emanuel ferritis</dc:creator>
		<pubDate>Wed, 02 Nov 2005 03:43:41 +0000</pubDate>
		<guid isPermaLink="false">http://ronrothman.com/public/leftbraned/?p=141#comment-255</guid>
		<description>dr. ron, thank you so much for posting this fix.  i tell you, if i had i nickel for every time the category exclusion parameter (4th param) of next_post_link() and previous_post_link() is effectively ignored...  i would have five cents.  fast programming related question - do i put your fix in before or after the &quot;if/then&quot; statement?</description>
		<content:encoded><![CDATA[<p>dr. ron, thank you so much for posting this fix.  i tell you, if i had i nickel for every time the category exclusion parameter (4th param) of next_post_link() and previous_post_link() is effectively ignored&#8230;  i would have five cents.  fast programming related question &#8211; do i put your fix in before or after the &#8220;if/then&#8221; statement?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.532 seconds -->
