Title: orderby isn&#8217;t working
Last modified: August 19, 2016

---

# orderby isn’t working

 *  [csleh](https://wordpress.org/support/users/csleh/)
 * (@csleh)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/oderby-isnt-working/)
 * Using this code:
 *     ```
       <?php
          if (is_page('partners'))  { ?>
       <?php $temp_query = $wp_query; ?>
       <?php query_posts('cat=10&orderby=title&order=ASC'); ?>
       <?php while (have_posts()) : the_post(); ?>
       <h3><?php the_title(); ?></h3>
       <?php the_content(); ?>
   
       <?php endwhile; ?>
        <?php }
       ?>
       ```
   
 * I expected alphabetical. My goal is actually reverse alphabetical, but this isn’t
   even showing “a” first. View it here:
    [http://www32.a2hosting.com/~mpallas/who-we-are/partners/](http://www32.a2hosting.com/~mpallas/who-we-are/partners/)
   NO posts in this category are set to sticky.

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

 *  [eric211c](https://wordpress.org/support/users/eric211c/)
 * (@eric211c)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/oderby-isnt-working/#post-807011)
 * I am having the same problem, any word on this?
 *  [ogre](https://wordpress.org/support/users/ogre/)
 * (@ogre)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/oderby-isnt-working/#post-807012)
 * What isn’t sorting alphabetically? Everything I looked at on that page looked
   sorted. FYI, to reverse sort: order=DESC
 *  Thread Starter [csleh](https://wordpress.org/support/users/csleh/)
 * (@csleh)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/oderby-isnt-working/#post-807034)
 * Link change:
    [http://www.lighthouseconsultingpartners.com/who-we-are/partners/](http://www.lighthouseconsultingpartners.com/who-we-are/partners/)
 * I don’t see the sorting. I see:
 * Detroit Chamber of Commerce
    Institute of Management Consultants Association 
   for Computing Machinery International Association for Outsourcing Professionals
 * But ‘A’ should come before ‘I’ if were sorting alphabetically.
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [17 years, 8 months ago](https://wordpress.org/support/topic/oderby-isnt-working/#post-807035)
 * If you’re not getting sorting, then I’d say your query is not getting executed
   properly, because that code is correct. orderby=title should work perfectly.
 * Can you post more of the page than just the snippet? Use [http://wordpress.pastebin.com](http://wordpress.pastebin.com)
   and post the link back here.
 *  Thread Starter [csleh](https://wordpress.org/support/users/csleh/)
 * (@csleh)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/oderby-isnt-working/#post-807036)
 * I was experimenting with using one template for many page types, so would be 
   great to know how I’m screwing up.
 * [http://wordpress.pastebin.com/m5dc931c5](http://wordpress.pastebin.com/m5dc931c5)
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [17 years, 8 months ago](https://wordpress.org/support/topic/oderby-isnt-working/#post-807037)
 * Hmmm.. Weird. Are you sure that this code is actually getting used? Is this like
   in your page.php file or what?
 *  Thread Starter [csleh](https://wordpress.org/support/users/csleh/)
 * (@csleh)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/oderby-isnt-working/#post-807038)
 * yes, this is page.php. I assume the code is being used, since category 10 (the
   partner listing) is shown. I don’t know how to test that though.

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

The topic ‘orderby isn’t working’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 4 participants
 * Last reply from: [csleh](https://wordpress.org/support/users/csleh/)
 * Last activity: [17 years, 8 months ago](https://wordpress.org/support/topic/oderby-isnt-working/#post-807038)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
