Post sort order question
-
I have a site with pages that need to list categories in 2 different ways. On the news page, all posts in the “news” category should list the most recent post first, but on the event page, all post in the “event” category should list in reverse order so the next upcoming event is at the top of the list.
Is there a php function I can use to change the sort order? For example, in the loop, can I put some logic that would say “if category = event, sort by DESC”?
I’ve tried doing that, but it didn’t work for me. I may just have incorrect syntax, but I’m not sure if I’m going about this correctly. Ive tried several plugins, but none seem to do what Im looking to do.
thanks everyone
The topic ‘Post sort order question’ is closed to new replies.