<?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>Cozmoslabs &#187; posts</title>
	<atom:link href="http://www.cozmoslabs.com/tag/posts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cozmoslabs.com</link>
	<description>Web design and development experiment.</description>
	<lastBuildDate>Wed, 08 Feb 2012 23:05:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Exclude posts from WordPress Navigation in Thematic</title>
		<link>http://www.cozmoslabs.com/961-exclude-posts-from-wordpress-navigation-in-thematic/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=exclude-posts-from-wordpress-navigation-in-thematic</link>
		<comments>http://www.cozmoslabs.com/961-exclude-posts-from-wordpress-navigation-in-thematic/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 11:01:45 +0000</pubDate>
		<dc:creator>Cristian</dc:creator>
				<category><![CDATA[Thematic]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[child theme]]></category>
		<category><![CDATA[code snippet]]></category>
		<category><![CDATA[exclude]]></category>
		<category><![CDATA[posts]]></category>

		<guid isPermaLink="false">http://www.cozmoslabs.com/?p=961</guid>
		<description><![CDATA[Let&#8217;s say you have a certain category that you want to be displayed some place other than on your main blog page. No big deal, you just exclude your special category from the main index loop. Now, you&#8217;re probably also want to make some changes to the single post navigation, and make it so that [...]
Related posts:<ol>
<li><a href='http://www.cozmoslabs.com/557-thematic-featured-posts/' rel='bookmark' title='Add &#8220;Featured Posts&#8221; to your Thematic child theme'>Add &#8220;Featured Posts&#8221; to your Thematic child theme</a></li>
<li><a href='http://www.cozmoslabs.com/300-quickly-add-a-category-dropdown-to-thematic-09/' rel='bookmark' title='Quickly add a Category DropDown to Thematic 0.9'>Quickly add a Category DropDown to Thematic 0.9</a></li>
<li><a href='http://www.cozmoslabs.com/1221-wordpress-pieces-of-code-of-the-month/' rel='bookmark' title='WordPress pieces of code of the month'>WordPress pieces of code of the month</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you have a certain category that you want to be displayed some place other than on your main blog page. No big deal, you just exclude your special category from the main index loop.</p>
<p>Now, you&#8217;re probably also want to make some changes to the single post navigation, and make it so that single posts in your special category won&#8217;t get posts from any other category in their navigation links. And also, chances are you&#8217;ll want to exclude posts from your special category from the navigation links of posts in all other categories.</p>
<p>In other words, in the navigation links of single posts from your special category you&#8217;ll only get posts from that category, and in the navigation links of posts from all other categories, you&#8217;ll get posts from all categories except your special category. Two separate navigations.</p>
<p><span id="more-961"></span></p>
<p>For all of this, all you need to do is use the following <strong>two Thematic filters</strong>: <code>thematic_previous_post_link_args</code> and <code>thematic_next_post_link_args</code>. If you&#8217;re interested to look into the code, you can find the filters being applied in <code>thematic/library/extensions/content-extensions.php</code></p>
<p>And here&#8217;s the code snippet to include in your child-theme&#8217;s <code>functions.php</code>:</p>

<div class="wp_codebox"><table><tr id="p9612"><td class="code" id="p961code2"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> custom_previous_post_link_args<span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>in_category<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$args</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'in_same_cat'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$args</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'excluded_categories'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$args</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thematic_previous_post_link_args'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom_previous_post_link_args'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> custom_next_post_link_args<span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>in_category<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$args</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'in_same_cat'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$args</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'excluded_categories'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$args</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thematic_next_post_link_args'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom_next_post_link_args'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Related posts:<ol>
<li><a href='http://www.cozmoslabs.com/557-thematic-featured-posts/' rel='bookmark' title='Add &#8220;Featured Posts&#8221; to your Thematic child theme'>Add &#8220;Featured Posts&#8221; to your Thematic child theme</a></li>
<li><a href='http://www.cozmoslabs.com/300-quickly-add-a-category-dropdown-to-thematic-09/' rel='bookmark' title='Quickly add a Category DropDown to Thematic 0.9'>Quickly add a Category DropDown to Thematic 0.9</a></li>
<li><a href='http://www.cozmoslabs.com/1221-wordpress-pieces-of-code-of-the-month/' rel='bookmark' title='WordPress pieces of code of the month'>WordPress pieces of code of the month</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.cozmoslabs.com/961-exclude-posts-from-wordpress-navigation-in-thematic/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

