categories – Sort Posts Alphabetically Based on Specific Category (Divi)


So I have a pretty simple question, and all the answers I’ve found so far have gotten me really close to what I want to do, but I haven’t been able to get it to work just yet:

How do I tell WordPress to sort posts of a specific category in order?

I’m building my site in Divi, so I’m trying to accomplish this using a child theme and editing the /includes/builder/module/blog.php file.

I can successfully get it to sort posts alphabetically by following this article, but I’m trying to figure out the correct way to wrap an if statement around that bit of code.

I know it’s pretty much just a matter of “if (category = specific_category)” then sort these post alphabetically, but I’m still learning my way around the code and haven’t figured out the correct syntax to make it work.

I’m sure someone within reading distance of this post is going to be like “oh yeah, this is how you do it,” so I thought I would ask. 🙂


jzn110 1 month 2022-12-24T14:09:37-05:00 0 Answers 0 views 0

Leave an answer