Wordpress Alphabetizing Posts

Wordpress Alphabetizing Posts

Wordpress post are usually order chronologically.

But sometimes you need the ordered another way

For http://forsythfacingforward.com/ they needed the post or links alphabetically.

forsythfacingforward

Just as the correct portion of the following code and your on your way

Here is the code. The most important part is in bold

?php
get_header();
?>

<div id="content">

<?php
// we add this, to show all posts in our
// Glossary sorted alphabetically
if (is_category('Glossary'))
{
     $posts = query_posts($query_string .
'&orderby=title&order=asc&posts_per_page=-1');
}
// here comes The Loop!
if (have_posts()) : while (have_posts()) : the_post(); ?>
People who read this also read:
  • How to add Adsense ads Between wordpress Post
  • 10 Great Wordpress Hacks & Tricks
  • Choose Your Wordpress sidebar
  • Best SEO Permalink Structure
  • Wordpress Show Parent Title if Showing Children Pages
  • WordPress Under Attack
  • Huffington Post Crowdsources Headlines in 5mins
  • If you have any questions, addtional information, or found this helpful "Leave a Comment" below.
    blog comments powered by Disqus