<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>ThemeShaper Forums Topic: filtering category from loop breaks page navigation</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Sat, 25 May 2013 06:12:00 +0000</pubDate>

<item>
<title>helgatheviking on "filtering category from loop breaks page navigation"</title>
<link>http://themeshaper.com/forums/topic/filtering-category-from-loop-breaks-page-navigation#post-22186</link>
<pubDate>Thu, 07 Jul 2011 03:58:38 +0000</pubDate>
<dc:creator>helgatheviking</dc:creator>
<guid isPermaLink="false">22186@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;yup, b/c query_posts('cat=-3');  means you've killed the other bits in your query... that tell WP what paginated page you are on. so you should either include the pagination parts (which i think might be shown on the blog template... i dont remember) &#60;/p&#62;
&#60;p&#62;OR&#60;br /&#62;
safely tack your args on to the query instead of completely replacing it&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;global $wp_query;
$args = array_merge( $wp_query-&#38;gt;query, array( &#38;#39;cat&#38;#39;=&#38;gt;-3 ) );
query_posts( $args );&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;which is straight out of the Codex&#60;br /&#62;
&#60;a href=&#34;http://codex.wordpress.org/Function_Reference/query_posts&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Function_Reference/query_posts&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>flippingtires on "filtering category from loop breaks page navigation"</title>
<link>http://themeshaper.com/forums/topic/filtering-category-from-loop-breaks-page-navigation#post-22184</link>
<pubDate>Thu, 07 Jul 2011 03:47:20 +0000</pubDate>
<dc:creator>flippingtires</dc:creator>
<guid isPermaLink="false">22184@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;We need to display our news category posts on their own separate page.  So I filtered the category from the main index as Chris described here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://themeshaper.com/forums/topic/filtering-one-category-from-index-loop&#34; rel=&#34;nofollow&#34;&#62;http://themeshaper.com/forums/topic/filtering-one-category-from-index-loop&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;'&#60;br /&#62;
//Remove news category from blog page to avoid double posting&#60;br /&#62;
function no_news_in_loop() {&#60;br /&#62;
     //test if we are on the blog page&#60;br /&#62;
     if(is_home())&#60;/p&#62;
&#60;p&#62;          {&#60;br /&#62;
               global $query_string;&#60;br /&#62;
               query_posts('cat=-3');&#60;br /&#62;
          }&#60;br /&#62;
     }&#60;br /&#62;
add_action('thematic_indexloop', 'no_news_in_loop');&#60;br /&#62;
'&#60;/p&#62;
&#60;p&#62;It works great, almost.  It causes my pagination links to stop working.  They load the appropriate page, i.e. blog/page/2/ and blog/page/3/, but the posts on every page are the same.&#60;/p&#62;
&#60;p&#62;I'm hoping there's a quick and easy fix for it?  I just can't seem to locate one.&#60;/p&#62;
&#60;p&#62;I suppose I should also mention that I've put the news category posts on their own page by copying page.php, renaming in to page-news.php, and creating a page template with it.  I then filter the index loop on that page with this function:&#60;/p&#62;
&#60;p&#62;'&#60;br /&#62;
//filter news category posts to only show on news page template&#60;/p&#62;
&#60;p&#62;function news_in_loop () {&#60;br /&#62;
     if(is_page_template('page-news.php'))&#60;/p&#62;
&#60;p&#62;               {&#60;br /&#62;
                    query_posts( $query_string . &#34;&#38;#38;cat=26&#34;);&#60;br /&#62;
               }&#60;br /&#62;
          }&#60;/p&#62;
&#60;p&#62;     add_action('thematic_indexloop', 'news_in_loop');&#60;br /&#62;
'&#60;/p&#62;
&#60;p&#62;This also works as needed, except for the same pagination issue.&#60;/p&#62;
&#60;p&#62;Thanks for your help.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
