WordPress.org

Ready to get started?Download WordPress

Forums

Types - Custom Fields and Custom Post Types Management
Using get_categories only for posts child of another post (1 post)

  1. wonderm00n
    Member
    Posted 9 months ago #

    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'?

    http://wordpress.org/extend/plugins/types/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.