This is quite confusing. Let’s see if I can explain myself…
I have the following:
– EVENTS (custom post type)
– SPONSORS (custom post type, child of EVENTS)
When on the events page I want to list the categories (sponsor-type) that have posts (SPONSORS) that belong to this event.
I’ve used this:
$categories=get_categories( array( 'taxonomy' => 'sponsor-type', 'custom_post_type'=>'sponsor' ) );
And it gets the correct “sponsor-type” list but for any event. How can I pass the event->ID to this in order to get only the ‘sponsor-type’ that have ‘sponsor’, child of a specific ‘event’?
- The topic ‘Using get_categories only for posts child of another post’ is closed to new replies.