Title: Posts order by
Last modified: August 22, 2016

---

# Posts order by

 *  [qsz](https://wordpress.org/support/users/qsz/)
 * (@qsz)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/posts-order-by-1/)
 * Hello,
    I need your help. Please can you help me to order all posts:
 * Example:
 *     ```
       $args = array(
       	'orderby' => 'meta_value_num',
             	'meta_key' => '_ss',
             	 'order' => 'DESC'
       	);
       ```
   

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

 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/posts-order-by-1/#post-5275137)
 * Can you clarify what isn’t working? Your code looks fine at first glance. Are
   you passing these arguments to a new query:
 *     ```
       $args = array(
           'orderby' => 'meta_value_num',
           'meta_key' => '_ss',
           'order' => DESC
       );
   
       $new_query = new WP_Query( $args );
   
       if ( $new_query->have_posts() ) :
       while ( $new_query->have_posts() ) : $new_query->the_post();
           ...loop code...
       endwhile;
       endif;
       ```
   
 *  Theme Author [presscustomizr](https://wordpress.org/support/users/nikeo/)
 * (@nikeo)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/posts-order-by-1/#post-5275231)
 * Hi [@qsz](https://wordpress.org/support/users/qsz/),
    You arguments look fine.
   Some useful doc on the order by (including a meta example) : [http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters](http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters)
 * Hope this helps
 *  Thread Starter [qsz](https://wordpress.org/support/users/qsz/)
 * (@qsz)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/posts-order-by-1/#post-5275235)
 * Thanks, but I’m beginner and cannot find the file in Customizr theme which I 
   should change.
    Is it index.php? If yes, should I paste the code before? `<?php
   do_action ('__before_loop');##hooks the heading of the list of post : archive,
   search... ?>`
 * If not, can you tell which file I should edit?
 *  Theme Author [presscustomizr](https://wordpress.org/support/users/nikeo/)
 * (@nikeo)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/posts-order-by-1/#post-5275242)
 * You need to edit the functions.php file.
 * You could use the following example of code :
    [http://sterlinghamilton.com/order-meta-values-wordpress/](http://sterlinghamilton.com/order-meta-values-wordpress/)
 * This requires some advanced php skills tough, I would recommend to ask the help
   of a proficient developer to implement this.
 *  [ElectricFeet](https://wordpress.org/support/users/electricfeet/)
 * (@electricfeet)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/posts-order-by-1/#post-5275360)
 * It would seem to me that the code you were using 9 months ago should work: [http://wordpress.org/support/topic/order-posts-in-category-and-taxonomy-page?replies=5](http://wordpress.org/support/topic/order-posts-in-category-and-taxonomy-page?replies=5)
 * There’s also an article on [How to customize Customizr](http://www.themesandco.com/customizr/how-to-customize-customizr-wordpress-theme/).

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

The topic ‘Posts order by’ is closed to new replies.

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

## Tags

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

 * 5 replies
 * 4 participants
 * Last reply from: [ElectricFeet](https://wordpress.org/support/users/electricfeet/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/posts-order-by-1/#post-5275360)
 * Status: not resolved