Joe Darrer
asked 8 years ago

Hi – I wanted to reverse the order of the timeline so I followed this post here:
https://www.designwall.com/question/how-to-sort-entries-by-date-in-reverse-order-asc/

However when I implemented this fix three things I noticed:

  1. The list of posts was limited to showing only 5
  2. It no longer followed the categories so all posts were showing on all pages
  3. On the homepage the posts from different categories started to get duplicated so the stream would show the same category of posts multiple times

Is there another way to approach this?

Cheers,
Joe

1 Answers
Allen
answered 8 years ago

@Joe : Hi, you can add this code to your Functions.php file :

function timeline_query_order($query) {
      $query->set('order', 'ASC');
}
add_action('pre_get_posts','timeline_query_order');
darrerjoe
replied 8 years ago

Thanks @Allen – That worked. Cheers for the help

Powered by DW Question & Answer Pro