WordPress.org

Ready to get started?Download WordPress

Forums

CPT-onomies: Using Custom Post Types as Taxonomies
[resolved] Grab a custom field from a CPTonomy (4 posts)

  1. Carrie Dils
    Member
    Posted 5 months ago #

    Maybe I need more coffee, but I'm having a hard time wrapping my brain around which function to use.

    Scenario:

    I'm on a single post for a CPT called "Actor", post name is "Carrie Dils."

    I have a CPTonomy called "Movie", with a related term called "Zombie Apocalypse."

    I want to pull in a custom field from the Zombie Apocalypse entry and display it on my single Carrie Dils post.

    Assume that the relationships are set up correctly. :)

    Is get_objects_in_term() the right function to use?

    Thank you!
    Carrie

    http://wordpress.org/plugins/cpt-onomies/

  2. Rachel Carden
    Member
    Plugin Author

    Posted 5 months ago #

    wp_get_object_terms is the right function and since a term's term id is the same as the post id then use get_post_meta with the "Zombie Apocalypse" term_id.

  3. Carrie Dils
    Member
    Posted 5 months ago #

    BOOM! That was the ticket. Thanks for the speedy reply!

  4. Rachel Carden
    Member
    Plugin Author

    Posted 5 months ago #

    No problem!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.