Title: Sorting posts by title
Last modified: August 21, 2016

---

# Sorting posts by title

 *  Resolved [geckoinbelize](https://wordpress.org/support/users/geckoinbelize/)
 * (@geckoinbelize)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/sorting-posts-by-title/)
 * I want to display my posts in alphabetical order rather than by date. I have 
   previously used
    `<?php if (have_posts()) : while (have_posts()) : the_post('&
   orderby=title&order=asc'); ?>` but when I put this in the index.php file it makes
   no difference.
 * Will this not work with this theme or is there another way to achieve an alphabetical
   list?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Styled Themes](https://wordpress.org/support/users/gejay/)
 * (@gejay)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/sorting-posts-by-title/#post-4540776)
 * You might want to check out this page in the Codex
 * [http://codex.wordpress.org/Alphabetizing_Posts](http://codex.wordpress.org/Alphabetizing_Posts)
 *  Thread Starter [geckoinbelize](https://wordpress.org/support/users/geckoinbelize/)
 * (@geckoinbelize)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/sorting-posts-by-title/#post-4540810)
 * Hi – as I wanted to change all my categories to show alphabetically I edited 
   the functions.php to include the example shown at the bottom of this codex but
   they still only show by date. I tried putting it in the Child theme, and also
   in the main theme but it made no difference. Any suggestions?
 *  [Styled Themes](https://wordpress.org/support/users/gejay/)
 * (@gejay)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/sorting-posts-by-title/#post-4540851)
 * You might want to check out some plugins that will do custom ordering…apparently
   they exist. Do a search in the plugins with the keywords “Post Ordering”
 *  Thread Starter [geckoinbelize](https://wordpress.org/support/users/geckoinbelize/)
 * (@geckoinbelize)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/sorting-posts-by-title/#post-4540856)
 * I found a solution – putting the following code before the loop in the category.
   php of the child theme did exactly what i needed.
 * `<?php if (is_category()) { $posts = query_posts($query_string . '&orderby=title&
   order=asc'); } ?>`

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Sorting posts by title’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/celestial-lite/3.5.8/screenshot.
   png)
 * Celestial - Lite
 * [Support Threads](https://wordpress.org/support/theme/celestial-lite/)
 * [Active Topics](https://wordpress.org/support/theme/celestial-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/celestial-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/celestial-lite/reviews/)

## Tags

 * [alphabetical](https://wordpress.org/support/topic-tag/alphabetical/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [sort](https://wordpress.org/support/topic-tag/sort/)

 * 4 replies
 * 2 participants
 * Last reply from: [geckoinbelize](https://wordpress.org/support/users/geckoinbelize/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/sorting-posts-by-title/#post-4540856)
 * Status: resolved