Title: Order posts by title ASC
Last modified: August 21, 2016

---

# Order posts by title ASC

 *  Resolved [svsdnb](https://wordpress.org/support/users/svsdnb/)
 * (@svsdnb)
 * [12 years ago](https://wordpress.org/support/topic/order-posts-by-title-asc/)
 * Is there a way that I can order posts by title? Right now they appear to be ordered
   by date or ordered by title DESC but I don’t see an array in the loop to order.

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

 *  Theme Author [Silkalns](https://wordpress.org/support/users/silkalns/)
 * (@silkalns)
 * [12 years ago](https://wordpress.org/support/topic/order-posts-by-title-asc/#post-4892013)
 * This is not part of the theme but it can be done.
 * Add this code to functions.php (preferably to Child theme functions.php )
 *     ```
       function sparkling_modify_query_order( $query ) {
           if ( $query->is_home() && $query->is_main_query() ) {
               $query->set( 'orderby', 'title' );
               $query->set( 'order', 'ASC' );
           }
       }
       add_action( 'pre_get_posts', 'sparkling_modify_query_order' );
       ```
   
 *  Thread Starter [svsdnb](https://wordpress.org/support/users/svsdnb/)
 * (@svsdnb)
 * [12 years ago](https://wordpress.org/support/topic/order-posts-by-title-asc/#post-4892050)
 * This worked perfectly! Than you!

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

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

 * ![](https://i0.wp.com/themes.svn.wordpress.org/sparkling/2.4.11/screenshot.png)
 * Sparkling
 * [Support Threads](https://wordpress.org/support/theme/sparkling/)
 * [Active Topics](https://wordpress.org/support/theme/sparkling/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/sparkling/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/sparkling/reviews/)

## Tags

 * [asc](https://wordpress.org/support/topic-tag/asc/)
 * [order by title](https://wordpress.org/support/topic-tag/order-by-title/)

 * 2 replies
 * 2 participants
 * Last reply from: [svsdnb](https://wordpress.org/support/users/svsdnb/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/order-posts-by-title-asc/#post-4892050)
 * Status: resolved