Create multiple sections for all categories and then queries all the posts for each of those categories

Figured out a solution. Ended up querying each categories using “foreach” and inserting my custom function into the loop. Not sure if it’s the best approach but I got it to work so eh. No one else seems to want to help.