WordPress.org

Ready to get started?Download WordPress

Forums

Want to Reverse Chronology of Blog (5 posts)

  1. ranger6350
    Member
    Posted 7 years ago #

    My blog is of a month-long trip to Asia. Now that it's over, I'd like to reverse the chronology of it so anyone new coming in to read it gets the first installment at the top. Is this possible? Thanks!
    Cheers,
    Ranger

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Put this before your Loop:
    query_posts($query_string . "&order=ASC");

    http://codex.wordpress.org/Template_Tags/query_posts

  3. ranger6350
    Member
    Posted 7 years ago #

    I read all I could and couldn't find where to put the code in that you suggested. My index.php file contains the following. Could you tell me where to insert the code snippet you specified in order to make it reverse? I tried several spots with no luck. Thanks!
    -R

    <?php get_header(); ?>
    
    <div id="content" class="narrowcolumn">
    
    <?php if (have_posts()) : ?>
    
    <?php while (have_posts()) : the_post(); ?>
    
    <div class="post" id="post-<?php the_ID(); ?>">
    <h2>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h2>
    <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
    
    <div class="entry">
    <?php the_content('Read the rest of this entry »'); ?>
    </div>
    
    <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    </div>
    
    <?php endwhile; ?>
    
    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Next Entries »') ?></div>
    </div>
    
    <?php else : ?>
    
    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    <?php endif; ?>
    
    </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Just below the get_header. Surround the code with the php tags as well.

  5. mperry8304
    Member
    Posted 7 years ago #

    Thanks so much. This really helped me out too!

Topic Closed

This topic has been closed to new replies.

About this Topic