1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wordpress - Display newest posts last

Discussion in 'Blogging' started by drogon, Oct 27, 2011.

  1. drogon

    drogon Elite Member Premium Member

    Joined:
    May 28, 2010
    Messages:
    2,107
    Likes Received:
    1,004
    How can i set a blog to add new posts as last entry and not first entry on my blog?

    Cheers.
     
  2. Pekton

    Pekton Regular Member

    Joined:
    Nov 28, 2009
    Messages:
    250
    Likes Received:
    104
    Location:
    upstate ny
  3. ronegraT

    ronegraT Power Member

    Joined:
    Dec 29, 2010
    Messages:
    620
    Likes Received:
    101
    Occupation:
    sleeping
    Location:
    Sweden
    Aren´t there a setting in wordpress to show the posts decending?
     
  4. drogon

    drogon Elite Member Premium Member

    Joined:
    May 28, 2010
    Messages:
    2,107
    Likes Received:
    1,004
    Nope. Hence why i am asking.
     
  5. drogon

    drogon Elite Member Premium Member

    Joined:
    May 28, 2010
    Messages:
    2,107
    Likes Received:
    1,004
  6. flx89

    flx89 Senior Member

    Joined:
    Apr 22, 2010
    Messages:
    1,158
    Likes Received:
    407
    Location:
    United States of Europe
    follow this:

    when you log in, go to settings - reading - and choose display latest posts, hope it helps

    thanks!
     
  7. tinkers

    tinkers Newbie

    Joined:
    Jun 16, 2011
    Messages:
    3
    Likes Received:
    1
    Hi,

    I am afraid you are going to have to change the index.php file but there is only one line to change.

    open your index.php file and search for :

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

    replace this with:

    <?php $posts=query_posts($query_string . '&order=asc');
    if (have_posts()) : while (have_posts()) : the_post(); ?>

    nothing else. This shoudl then return a list with oldest posts first.
     
  8. drogon

    drogon Elite Member Premium Member

    Joined:
    May 28, 2010
    Messages:
    2,107
    Likes Received:
    1,004
    Sorry but this path does not exist in Wordpress!
     
  9. drogon

    drogon Elite Member Premium Member

    Joined:
    May 28, 2010
    Messages:
    2,107
    Likes Received:
    1,004

    Tried that but nothing happened. Thanks anyway.
     
  10. tinkers

    tinkers Newbie

    Joined:
    Jun 16, 2011
    Messages:
    3
    Likes Received:
    1
    You did make this amendment to your index.php of your theme right? I guess I shoud have said that. If you are using a theme which has a home.php or index.php, this is the file you need to change.
     
  11. drogon

    drogon Elite Member Premium Member

    Joined:
    May 28, 2010
    Messages:
    2,107
    Likes Received:
    1,004
    Yes, i amended the index.php file as above but absolutely nothing happened!

    I am using the Evolve theme.
     
  12. AternusW

    AternusW Newbie

    Joined:
    Aug 24, 2009
    Messages:
    29
    Likes Received:
    78
    <?php
    $args = array( 'post_type' => 'post', 'orderby' => 'date', 'order' => 'DESC' );
    query_posts($args);

    if (have_posts()) : while( have_posts() ) : the_post();
    ?>

    YOUR POST HTML

    <?php endwhile; endif; wp_reset_query(); ?>
     
  13. Pekton

    Pekton Regular Member

    Joined:
    Nov 28, 2009
    Messages:
    250
    Likes Received:
    104
    Location:
    upstate ny
    if you have that plugin still intsalled open up your index file and add this
    PHP:
    <?php sort_query_posts_by('date''desc'); ?>
    It needs to go just before the loop starts . if your theme is evolve 1.2.7 the loops starts with
    PHP:
    <?php if ( have_posts() ) : ?>
    unfortunately evolves index has 5 loops on it . I think you only need to add it before the loops that start at lines 385,592,799

    make a back up of your index file first before altering anything
     
  14. webnise

    webnise Regular Member

    Joined:
    Dec 21, 2009
    Messages:
    296
    Likes Received:
    121
    Location:
    London
    Change the date of the new post older than the date of the last post.