Wp query that combines posts and taxonomy terms

[ad_1]

I have a cpt “member” which has 2 (bidirectional) acf fields.

1. Relationship field adding posts from cpt “specialties”
2. Taxonomy field adding (existing) terms from custom taxonomy “specialty-categories”

Basically a member can be assigned to whole categories but also to single posts within any category.

Querying and displaying the assigned posts from the custom cpt works fine.

I’m not sure however, how to query the assigned terms from the 2nd point above. Most of what I found relates to finding posts that have some category assigned, not getting the categories themselves.

Lastly, I’d love to have one query that gets all posts as well as categories so I can put them into one list which I can then order, instead of having two separate lists.

Any pointers would be much appreciated!

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer