Title: Alphabetizing posts
Last modified: August 20, 2016

---

# Alphabetizing posts

 *  Resolved [TheElear](https://wordpress.org/support/users/peterpap/)
 * (@peterpap)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/alphabetizing-posts-2/)
 * I wanted to have all my posts in all categories displayed in alphabetical order.
   In the child theme of my twenty ten I copied the category.php file and added 
   the following piece of code (found on this forum) before the loop is called:
   `
   $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page
   =-1');`
 * It works like dream! All posts now are in alphabetical order.
 * However one thing has changed – pagination of posts. So in a given category I
   can see now one long list of all category posts, rather than lets 10 and link
   to ‘Older Posts’ and ‘Newer posts’. These links simply disappeared.
 * Any ideas how to alphabetize posts and keep the pagination?
 * regards,
    Peter

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/alphabetizing-posts-2/#post-2530746)
 * try and remove
    `&posts_per_page=-1` from the query.
 * this part basically instructs the loop to: _show **all **posts_.
 *  Thread Starter [TheElear](https://wordpress.org/support/users/peterpap/)
 * (@peterpap)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/alphabetizing-posts-2/#post-2530761)
 * Thanks alchmyth. It works.
 * I also found that ‘-1’ instructs to show **all** posts, but can be changed to
   whatever number of posts one wants to have displayed. So for example if I want
   to have 5 posts per page then the code will read:
    `&posts_per_page=5`. Navigation
   is then automatically added back.
 * many thanks,

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

The topic ‘Alphabetizing posts’ is closed to new replies.

## Tags

 * [alphabetizing posts](https://wordpress.org/support/topic-tag/alphabetizing-posts/)
 * [twenty ten](https://wordpress.org/support/topic-tag/twenty-ten/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [TheElear](https://wordpress.org/support/users/peterpap/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/alphabetizing-posts-2/#post-2530761)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
