I have a website for an organisation, and I created a new page for the leadership team. I ran a query, looking for the “member”-type that have the category of “Leadership”. So far, when I output this on the page, it works fine. I also have child categories of “President” and “Secretary” that I want to display beside each leader’s name. However, as soon as I call get_the_category(), everything gets messed up, and only one result is output, and the President category somehow disappears and the post with the category of “President” gets “Secretary” displayed next to it.
This is the relevant code: