orderby isn't working (8 posts)

  1. csleh
    Posted 6 years ago #

    Using this code:

       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:
    NO posts in this category are set to sticky.

  2. eric211c
    Posted 6 years ago #

    I am having the same problem, any word on this?

  3. Ogre
    Posted 6 years ago #

    What isn't sorting alphabetically? Everything I looked at on that page looked sorted. FYI, to reverse sort: order=DESC

  4. csleh
    Posted 6 years ago #

    Link change:

    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.

  5. 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 and post the link back here.

  6. csleh
    Posted 6 years ago #

    I was experimenting with using one template for many page types, so would be great to know how I'm screwing up.


  7. Hmmm.. Weird. Are you sure that this code is actually getting used? Is this like in your page.php file or what?

  8. csleh
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic