Title: Ordering custom posts within a customized loop
Last modified: August 20, 2016

---

# Ordering custom posts within a customized loop

 *  [gluethje](https://wordpress.org/support/users/gluethje/)
 * (@gluethje)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/ordering-custom-posts-within-a-customized-loop/)
 * OK, let’s see if I can efficiently explain my setup…
 * First, I’m not super handy with PHP. I can see what’s going on, tweak things 
   I find to suit my needs, and I’m pretty good at not screwing things up, but I
   can’t really write it on my own.
 * I am using the Custom Post Type UI plugin to to create custom posts and taxonomies
   to organize products by product type.
 * I’m using a custom page template to display a grid of product boxes on product
   category pages. [Example](http://getc.thefstopdesign.com/store/hoof-boots-accessories/).
   
   This page template looks like this:
 * _[for more than 10 lines of code, please use the [http://pastebin.com/](http://pastebin.com/)–
   see [http://codex.wordpress.org/Forum\_Welcome#Posting\_Code](http://codex.wordpress.org/Forum_Welcome#Posting_Code)]_
 * I need a way for the client easily reorder these product boxes. I’m trying to
   use the Postmash plugin, and it does seem to order the way the posts show up 
   in the admin panel, but I can’t seem to get it to apply on this custom page. 
   Adding ‘order’ => ‘ASC’ in the query_posts() array did change the order to ascending,
   but I can get the Postmash filter’s order to apply
 * As I said, the necessity is to have the client be able to easily re-order these
   things after I’m done and hand the site over.
 * I hope I’ve explained this well enough without getting to complicated…

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

 *  Thread Starter [gluethje](https://wordpress.org/support/users/gluethje/)
 * (@gluethje)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/ordering-custom-posts-within-a-customized-loop/#post-2255024)
 * Oops forgot about the code limit. Here is the pastebin link:
    [http://pastebin.com/uTqR1ANs](http://pastebin.com/uTqR1ANs)
 *  Thread Starter [gluethje](https://wordpress.org/support/users/gluethje/)
 * (@gluethje)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/ordering-custom-posts-within-a-customized-loop/#post-2255037)
 * Solved this one on my own. Kind of a “duh” moment, but then I’m a PHP n00b, so
   I feel pretty good about it.
 * My little loop went something like this (I wish I could say I wrote it all myself.
   But it is based on a few different things I found here and there, and I have 
   significantly altered it):
 *     ```
       <?php if ( (is_page('Hoof Boots & Accessories')) ){
                      $args = array(
                         'post_type'                  => 'products',
                         'product_category'     => 'Hoof Boots',
                         'order'                        => 'ASC'
                        );
   
                       query_posts($args);
                       while (have_posts()) {
                       the_post();
        ?>
       ```
   
 * And I figured out all I had to do was change ‘order’ => ‘ASC’ to ‘orderby’ =>‘
   menu_order’.
 * Bam!
 * Hope it helps someone else…

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

The topic ‘Ordering custom posts within a customized loop’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 1 participant
 * Last reply from: [gluethje](https://wordpress.org/support/users/gluethje/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/ordering-custom-posts-within-a-customized-loop/#post-2255037)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
