Support » Fixing WordPress » sort category posts by date asc

  • hi
    i am trying to show the posts of a certain categoy (ID:306) ordered by date ascending (instead that descending) but it seems that i am not succeding in it.
    Can anyone please tell me exactly what to modify and where?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can create a category template (in your case it would be category-306.php) with a query_posts() loop.

    if (have_posts()) :
    while (have_posts()) : the_post();
    <!-- display post e.g. the_content() -->

    The Loop
    Template Hierarchy

    I’ve been trying this every which way, and it’s not working properly for me:

    <?php query_posts($query_string.'&orderby=date&order=ASC'); ?>
        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                    <div id="post-<?php the_ID(); ?>" class="thumbnail">
    <a href="<?php echo get_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><h3 id="post-<?php t
    he_ID(); ?>"><?php the_title(); ?></h3><img src="<?php echo get_post_meta($post->ID, "Thumbnail", true);
    ?>" alt="<?php the_title(); ?> <?php _e(''); ?>" /></a>
          <p><?php the_category(', ') ?></p>
        <?php endwhile; //end one post ?>
    <?php endif; ?>

    The results are still ordered by title alphabetically. Can you help?

    Hy there

    i’m interested in that aswell and i got an ideea but i’m a designer not a programer i want to order the events so that i can show the next events on the homepage

    so what about ordering by date if i make the date a custom field… am i talking non sense or is that posible?

    can anyone help?


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘sort category posts by date asc’ is closed to new replies.