Echo child category/taxonomy name in loop

Home Forums Calendar Products Events Calendar PRO Echo child category/taxonomy name in loop

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #21723
    Richard
    Member

    Hello.

    I having trouble displaying a child taxonomy name. Here’s what I’m trying to do. I have the Events category ‘specials’ with its children ‘lunch’ and ‘dinner.’ All I want to do is echo the name of the child taxonomy depending on whether it’s in ‘lunch’ or ‘dinner.’ So if it’s a lunch special ‘lunch’ automatically appears without having to manually type it in.

    I assume this can be done using get_terms() or get_the_terms() in conjunction with something like:

    ‘tax_query’=> array(
    array(
    ‘taxonomy’ => ‘tribe_events_cat’,
    ‘field’ => ‘id’,
    ‘terms’ => ‘102’,
    ‘operator’ => ‘IN’
    )
    )

    …but I haven’t been able to get it to work.

    Thank you for any help you can give me!

    ECP/TEC 2.0.7
    WP 3.4.1

    #21751
    Jonah
    Participant

    Hi Richard,

    tax_query is only to be used as a query parameter within wp_query or tribe_get_events – you should be able to use one of the other native WordPress functions to get the taxonomy name. http://codex.wordpress.org/Function_Reference/get_terms – look at the bottom for other related functions.

    I hope that helps!

    – Jonah

    #21773
    Richard
    Member

    Thanks, Jonah. That narrows things down a bit.

    #22010
    Rob
    Member

    Glad to hear this was of some value to you, Richard, and sorry we couldn’t offer up more. If you have any other questions down the road please let us know…and thanks for your support so far.

    #977332
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Echo child category/taxonomy name in loop’ is closed to new replies.