Support » Fixing WordPress » Query post type in category page

  • Resolved jumust


    I have a custom post type category page : custom_category.php

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<?php endwhile; endif; ?>

    It gets all posts correctly in each current subcategory, in chronologically order but I want them to be alphabetically sorted and still get posts from current category.

    Hope you can help me.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can alter the query with query_posts() (Codex)

    The example about “Preserving Existing Query Parameters” does almost exactly what you want (I guess):

    global $query_string;
    query_posts( $query_string . '&order=ASC' );

    (This should go before the loop)

    Great it did the job!

    Glad I could help.
    Please mark this thread as resolved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Query post type in category page’ is closed to new replies.