WordPress.org

Ready to get started?Download WordPress

Forums

changing order of posts (8 posts)

  1. coollouisvillehomes
    Member
    Posted 7 years ago #

    By default my posts are in order of oldest to newest. Is there a quick way to change the order to newest to oldest without having to edit the index code (I'm not a programmer).

    The url to my blog is http://www.coollouisvillehomes.com/new/blog/?p=1#comments

    Thanks in advance.

  2. moshu
    Member
    Posted 7 years ago #

    Those are not posts - those are comments. You will have to edit the comments.php file.

  3. coollouisvillehomes
    Member
    Posted 7 years ago #

    is there any documentation you can recommend that will tell me exactly what part of the code to edit.

  4. silpstream
    Member
    Posted 7 years ago #

    C,

    I'm taking a shot at this as there is no easy way from the comments.php file to change this. You can try (I stress try!!) to add the following between the lines:

    <?php if ($comments) : ?>
    <?php $comments = array_reverse($comments); ?>
    <?php foreach ($comments as $comment) : ?>

    add the middle line...

    Hope it works!

  5. coollouisvillehomes
    Member
    Posted 7 years ago #

    it worked...you rock!

  6. silpstream
    Member
    Posted 7 years ago #

    C,

    That's good to hear! could you please mark this as resolved? Cheers!

  7. BradyDale
    Member
    Posted 6 years ago #

    silpstream,
    can you revise that code so that it could go on a category page and arrange all posts within a category from oldest to newest?
    ???

  8. BradyDale
    Member
    Posted 6 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags