<?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: a function to change the order of posts in a category?</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Wed, 19 Jun 2013 16:38:33 +0000</pubDate>

<item>
<title>butters81 on "a function to change the order of posts in a category?"</title>
<link>http://themeshaper.com/forums/topic/a-function-to-change-the-order-of-posts-in-a-category#post-18131</link>
<pubDate>Wed, 05 Jan 2011 11:37:28 +0000</pubDate>
<dc:creator>butters81</dc:creator>
<guid isPermaLink="false">18131@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;I ran into the similar problem trying to get WP/Thematic to sort a couple of my categories alphabetically. &#60;/p&#62;
&#60;p&#62;This is a nice little filter function I found elsewhere on the forum, which displays all the posts for one category (54) and I've added alphabetical sorting for categories 5 and 10. Add this to your functions.php:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function show_all_post_in_cat() {
  if (is_category(&#38;#39;54&#38;#39;)) {
query_posts(&#38;#39;cat=54&#38;#38;posts_per_page=-1&#38;#38;order=asc&#38;#38;orderby=title&#38;#39;);
  }
  if (is_category(array(5,10))) { //order alphabetically
  global $query_string;
query_posts($query_string . &#38;#39;&#38;#38;order=asc&#38;#38;orderby=title&#38;#39;);
  }
}
add_action(&#38;#39;thematic_above_categoryloop&#38;#39;,&#38;#39;show_all_post_in_cat&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Useful info about $query_string here:&#60;br /&#62;
&#60;a href=&#34;http://codex.wordpress.org/Function_Reference/query_posts#Usage_Note&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Function_Reference/query_posts#Usage_Note&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>lastraw on "a function to change the order of posts in a category?"</title>
<link>http://themeshaper.com/forums/topic/a-function-to-change-the-order-of-posts-in-a-category#post-12950</link>
<pubDate>Wed, 09 Jun 2010 19:19:05 +0000</pubDate>
<dc:creator>lastraw</dc:creator>
<guid isPermaLink="false">12950@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;YAY! Thank you sooooo much Gene.&#60;/p&#62;
&#60;p&#62;Leslie
&#60;/p&#62;</description>
</item>
<item>
<title>em hr on "a function to change the order of posts in a category?"</title>
<link>http://themeshaper.com/forums/topic/a-function-to-change-the-order-of-posts-in-a-category#post-12935</link>
<pubDate>Wed, 09 Jun 2010 14:22:22 +0000</pubDate>
<dc:creator>em hr</dc:creator>
<guid isPermaLink="false">12935@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi Leslie,&#60;/p&#62;
&#60;p&#62;I took a look at your functions.php and there's nothing in there that is at odds with what you are trying to do here.&#60;/p&#62;
&#60;p&#62;Try this variation of the code you multicolumn loop that you posted:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;!-- FIRST LOOP: display posts 1 thru 5--&#38;gt;
&#38;lt;?php query_posts(&#38;#39;showposts=5&#38;#39;); ?&#38;gt;
&#38;lt;?php $posts = get_posts(&#38;#39;numberposts=5&#38;#38;offset=0&#38;#38;orderby=title&#38;#38;order=asc&#38;#38;cat=16&#38;#39;); foreach ($posts as $post) : start_wp(); ?&#38;gt;
&#38;lt;?php static $count1 = 0; if ($count1 == &#38;quot;5&#38;quot;) { break; } else { ?&#38;gt;
&#38;lt;div class=&#38;quot;entry-title&#38;quot;&#38;gt;&#38;lt;?php the_title(); ?&#38;gt;&#38;lt;/div&#38;gt;
&#38;lt;?php the_content(); ?&#38;gt;
&#38;lt;?php $count1++; } ?&#38;gt;
&#38;lt;?php endforeach; ?&#38;gt;
&#38;lt;/div&#38;gt;

&#38;lt;div id=&#38;quot;column_02&#38;quot;&#38;gt;

&#38;lt;!-- SECOND LOOP: display posts 6 thru 10--&#38;gt;
&#38;lt;?php query_posts(&#38;#39;showposts=5&#38;#39;); ?&#38;gt;
&#38;lt;?php $posts = get_posts(&#38;#39;numberposts=5&#38;#38;offset=5&#38;#38;orderby=title&#38;#38;order=asc&#38;#38;cat=16&#38;#39;); foreach ($posts as $post) : start_wp(); ?&#38;gt;
&#38;lt;?php static $count2 = 0; if ($count2 == &#38;quot;5&#38;quot;) { break; } else { ?&#38;gt;
&#38;lt;div class=&#38;quot;entry-title&#38;quot;&#38;gt;&#38;lt;?php the_title(); ?&#38;gt;&#38;lt;/div&#38;gt;
&#38;lt;?php the_content(); ?&#38;gt;
&#38;lt;?php $count2++; } ?&#38;gt;
&#38;lt;?php endforeach; ?&#38;gt;
&#38;lt;/div&#38;gt;
&#38;lt;div id=&#38;quot;column_03&#38;quot;&#38;gt;

&#38;lt;!-- THIRD LOOP: display posts 11 thru 15--&#38;gt;
&#38;lt;?php query_posts(&#38;#39;showposts=6&#38;#39;); ?&#38;gt;
&#38;lt;?php $posts = get_posts(&#38;#39;numberposts=5&#38;#38;offset=10&#38;#38;orderby=title&#38;#38;order=asc&#38;#38;cat=16&#38;#39;); foreach ($posts as $post) : start_wp(); ?&#38;gt;
&#38;lt;?php static $count3 = 0; if ($count3 == &#38;quot;5&#38;quot;) { break; } else { ?&#38;gt;
&#38;lt;div class=&#38;quot;entry-title&#38;quot;&#38;gt;&#38;lt;?php the_title(); ?&#38;gt;&#38;lt;/div&#38;gt;
&#38;lt;?php the_content(); ?&#38;gt;
&#38;lt;?php $count3++; } ?&#38;gt;
&#38;lt;?php endforeach; ?&#38;gt;
&#38;lt;/div&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>lastraw on "a function to change the order of posts in a category?"</title>
<link>http://themeshaper.com/forums/topic/a-function-to-change-the-order-of-posts-in-a-category#post-12927</link>
<pubDate>Tue, 08 Jun 2010 22:40:48 +0000</pubDate>
<dc:creator>lastraw</dc:creator>
<guid isPermaLink="false">12927@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Thank you Gene, I sent the template and the function file. I really appreciate you taking the time to take a look.&#60;/p&#62;
&#60;p&#62;Leslie
&#60;/p&#62;</description>
</item>
<item>
<title>em hr on "a function to change the order of posts in a category?"</title>
<link>http://themeshaper.com/forums/topic/a-function-to-change-the-order-of-posts-in-a-category#post-12922</link>
<pubDate>Tue, 08 Jun 2010 18:36:17 +0000</pubDate>
<dc:creator>em hr</dc:creator>
<guid isPermaLink="false">12922@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi lastraw-&#60;/p&#62;
&#60;p&#62;It's always challenging coming in in the middle of an issue and getting it right. Zip and email the template in question &#38;#38; I'll take a look. &#60;/p&#62;
&#60;p&#62;-Gene
&#60;/p&#62;</description>
</item>
<item>
<title>lastraw on "a function to change the order of posts in a category?"</title>
<link>http://themeshaper.com/forums/topic/a-function-to-change-the-order-of-posts-in-a-category#post-12914</link>
<pubDate>Tue, 08 Jun 2010 17:53:05 +0000</pubDate>
<dc:creator>lastraw</dc:creator>
<guid isPermaLink="false">12914@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Sorry to bump this, but my deadline approacheth!&#60;br /&#62;
arturkim's suggestion should have worked?
&#60;/p&#62;</description>
</item>
<item>
<title>lastraw on "a function to change the order of posts in a category?"</title>
<link>http://themeshaper.com/forums/topic/a-function-to-change-the-order-of-posts-in-a-category#post-12871</link>
<pubDate>Mon, 07 Jun 2010 19:36:50 +0000</pubDate>
<dc:creator>lastraw</dc:creator>
<guid isPermaLink="false">12871@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi arturkim,&#60;/p&#62;
&#60;p&#62;I appreciate you responding, but it still isn't working.&#60;/p&#62;
&#60;p&#62;Here is the first part of the file, I wonder if it has something to do with using query_posts outside the main loop?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
/*
Template Name: Clients

*/
?&#38;gt;
&#38;lt;?php

    // calling the header.php
    get_header();

    // action hook for placing content above #container
    thematic_abovecontainer();

?&#38;gt;
	&#38;lt;div id=&#38;quot;container-full&#38;quot;&#38;gt;
		&#38;lt;div id=&#38;quot;content-full&#38;quot;&#38;gt;
&#38;lt;div id=&#38;quot;post-&#38;lt;?php the_ID(); ?&#38;gt;&#38;quot; class=&#38;quot;&#38;lt;?php thematic_post_class() ?&#38;gt;&#38;quot;&#38;gt;
      &#38;lt;?php // creating the post header
                thematic_postheader();
?&#38;gt;
      &#38;lt;div class=&#38;quot;entry-content&#38;quot;&#38;gt;
        &#38;lt;?php the_content();
                     ?&#38;gt;

      &#38;lt;/div&#38;gt;
    &#38;lt;/div&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>arturkim on "a function to change the order of posts in a category?"</title>
<link>http://themeshaper.com/forums/topic/a-function-to-change-the-order-of-posts-in-a-category#post-12832</link>
<pubDate>Sat, 05 Jun 2010 16:15:38 +0000</pubDate>
<dc:creator>arturkim</dc:creator>
<guid isPermaLink="false">12832@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Just add&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;#38;orderby=title&#38;#38;order=asc&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;to the query_posts functions.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php query_posts(&#38;#39;showposts=5&#38;#38;cat=16&#38;#38;orderby=title&#38;#38;order=asc&#38;#39;); ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>lastraw on "a function to change the order of posts in a category?"</title>
<link>http://themeshaper.com/forums/topic/a-function-to-change-the-order-of-posts-in-a-category#post-12783</link>
<pubDate>Thu, 03 Jun 2010 18:44:50 +0000</pubDate>
<dc:creator>lastraw</dc:creator>
<guid isPermaLink="false">12783@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;I found this in the codex but I can't seem to combine it with the above code to make it work. If anyone has any ideas I would REALLY appreciate it.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Leslie&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
// we add this, to show all posts in our
// Glossary sorted alphabetically
if (is_category(&#38;#39;Glossary&#38;#39;))
{
     $posts = query_posts($query_string .
&#38;#39;&#38;#38;orderby=title&#38;#38;order=asc&#38;#39;);
}
// here comes The Loop!
if (have_posts()) : while (have_posts()) : the_post(); ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>lastraw on "a function to change the order of posts in a category?"</title>
<link>http://themeshaper.com/forums/topic/a-function-to-change-the-order-of-posts-in-a-category#post-12753</link>
<pubDate>Wed, 02 Jun 2010 22:34:53 +0000</pubDate>
<dc:creator>lastraw</dc:creator>
<guid isPermaLink="false">12753@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi all,&#60;/p&#62;
&#60;p&#62;I have this code on a template page to put posts from a single category (16 in this case)in a multi column layout, and it works, except it arranges the posts by date instead of alpha. I'm assuming there is a function for this kind of thing? &#60;/p&#62;
&#60;p&#62;Thank you!&#60;/p&#62;
&#60;p&#62;Leslie&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;div id=&#38;quot;column_01&#38;quot;&#38;gt;

&#38;lt;!-- FIRST LOOP: display posts 1 thru 5--&#38;gt;
&#38;lt;?php query_posts(&#38;#39;showposts=5&#38;#38;cat=16&#38;#39;); ?&#38;gt;
&#38;lt;?php $posts = get_posts(&#38;#39;numberposts=5&#38;#38;offset=0&#38;#39;); foreach ($posts as $post) : start_wp(); ?&#38;gt;
&#38;lt;?php static $count1 = 0; if ($count1 == &#38;quot;5&#38;quot;) { break; } else { ?&#38;gt;
&#38;lt;div style=&#38;quot;entry-title&#38;quot;&#38;gt;&#38;lt;?php the_title(); ?&#38;gt;&#38;lt;/div&#38;gt;
&#38;lt;?php the_content(); ?&#38;gt;
&#38;lt;?php $count1++; } ?&#38;gt;
&#38;lt;?php endforeach; ?&#38;gt;
&#38;lt;/div&#38;gt;

	&#38;lt;div id=&#38;quot;column_02&#38;quot;&#38;gt;

&#38;lt;!-- SECOND LOOP: display posts 6 thru 10--&#38;gt;
&#38;lt;?php query_posts(&#38;#39;showposts=5&#38;#38;cat=16&#38;#39;); ?&#38;gt;
&#38;lt;?php $posts = get_posts(&#38;#39;numberposts=5&#38;#38;offset=5&#38;#39;); foreach ($posts as $post) : start_wp(); ?&#38;gt;
&#38;lt;?php static $count2 = 0; if ($count2 == &#38;quot;5&#38;quot;) { break; } else { ?&#38;gt;
&#38;lt;div style=&#38;quot;entry-title&#38;quot;&#38;gt;&#38;lt;?php the_title(); ?&#38;gt;&#38;lt;/div&#38;gt;
&#38;lt;?php the_content(); ?&#38;gt;
&#38;lt;?php $count2++; } ?&#38;gt;
&#38;lt;?php endforeach; ?&#38;gt;
&#38;lt;/div&#38;gt;
&#38;lt;div id=&#38;quot;column_03&#38;quot;&#38;gt;

&#38;lt;!-- THIRD LOOP: display posts 11 thru 15--&#38;gt;
&#38;lt;?php query_posts(&#38;#39;showposts=6&#38;#38;cat=16&#38;#39;); ?&#38;gt;
&#38;lt;?php $posts = get_posts(&#38;#39;numberposts=5&#38;#38;offset=10&#38;#39;); foreach ($posts as $post) : start_wp(); ?&#38;gt;
&#38;lt;?php static $count3 = 0; if ($count3 == &#38;quot;5&#38;quot;) { break; } else { ?&#38;gt;
&#38;lt;div style=&#38;quot;entry-title&#38;quot;&#38;gt;&#38;lt;?php the_title(); ?&#38;gt;&#38;lt;/div&#38;gt;
&#38;lt;?php the_content(); ?&#38;gt;
&#38;lt;?php $count3++; } ?&#38;gt;
&#38;lt;?php endforeach; ?&#38;gt;
&#38;lt;/div&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>

</channel>
</rss>
