Blog posts order

  • Glenn
    Glenn
    Newbie 15 points
    April 17, 2015 at 1:47 am

    My blog posts are showing oldest to newest and the default in WordPress is newest to oldest which is what I want. I tried a few plugins but none worked. One thing I tried was changing themes and the blog posts showed in the default. How can I change the theme to show the post order newest published date to oldest publish date? Would be nice if we could use the presets for the home page design on any page.

  • Glenn
    Glenn
    Newbie 15 points
    April 19, 2015 at 5:18 pm

    I really need some help with this.

  • Glenn
    Glenn
    Newbie 15 points
    April 20, 2015 at 7:48 pm

    Does anyone from PremiumPress look at these posts on a regular basis????


  • Josh
    Super Guru 13,875 points
    April 20, 2015 at 8:41 pm

    Hello Glenn
    In your Theme directory open the file tpl-blog.php and locate this line:
    $posts = query_posts(“paged=”.$paged.”&post_type=post”);
    replace it with
    [code title=””]
    $posts = query_posts(“paged=”.$paged.”&post_type=post&orderby=date&order=desc”);
    [/code]

  • Glenn
    Glenn
    Newbie 15 points
    April 21, 2015 at 12:57 am

    Hi Josh.

    I gave that a try and still have the code there. It did not have any affect on the blog at all. Any other suggestions?

  • Mark Fail
    Mark Fail
    Super Guru 13,013 points
    April 21, 2015 at 7:07 am

    you may need;

    orderby=post_date&order=asc

  • Glenn
    Glenn
    Newbie 15 points
    April 21, 2015 at 1:50 pm

    I also deactivate all the plugins but that did not affect the sorting either.

  • Glenn
    Glenn
    Newbie 15 points
    April 21, 2015 at 1:55 pm

    Mark,
    Are you saying the line should look like this?
    $posts = query_posts(“paged=”.$paged.”&post_type=post&orderby=post_date&order=asc”);

    I tried that but did not change anything.

  • Glenn
    Glenn
    Newbie 15 points
    April 25, 2015 at 2:46 am

    Do I need to do a ticket for this??


  • Jonathan
    Newbie 1 points
    July 27, 2015 at 2:51 pm

    Hi, were you able to get this resolved ? I am having a similar issue and would like to know if/how you got this resolved.
    Thanks!
    Jonathan

  • Mike
    Mike
    Newbie 16 points
    November 24, 2016 at 1:38 am

    Guys this code is for older themes. How do I accomplish this in the newest theme version 8.9.6?

    The code mentioned above looks different in the new tpl-blog.php

    Right now posts are being sorted by updated date instead from newest to oldest

    thanks in advance
    Mike


  • Josh
    Super Guru 13,875 points
    November 24, 2016 at 1:24 pm

    Hello Mike,
    Your code should be:

    $args = array(
    'post_type' => 'post',
    'posts_per_page' => 15,
    'paged' => $paged,
    'orderby' =>post_date,
    'order' =>asc,
    );


  • Brian
    Newbie 37 points
    March 5, 2019 at 12:22 am

    I tried making the suggested change for 8.9.6 and it made no difference. Blog posts are still shown oldest to newest. Any ideas?

  • Marie
    Marie
    Super Guru 1,818 points
    March 5, 2019 at 5:40 am

    hi Brian

    where did you added the code?

Viewing 14 posts - 1 through 14 (of 14 total)

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes