Display child category of parent in single-event.php

Home Forums Calendar Products Events Calendar PRO Display child category of parent in single-event.php

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1387257
    Simon Oetang
    Participant

    We want to show the specific child category on a single-event that’s displayed in the loop view of a list.

    We already wrote a class in the single-event.php file -> events-category-grade, but we can’t find the correct way to show the child category of a parent category in this area.

    #1387798
    Simon Oetang
    Participant

    We tried several code examples that we founded on the forum but nothing gives us the result we want.

    We get the event categories to show up, but we only want to show the child categories of a specific category for example the child categories for the category with id 194.

    #1388485
    Victor
    Member

    Hi Simon!

    Thanks for getting in touch with us. Let me try to help you with this topic.

    First, please let me note that we are fairly limited in how much support we can give for custom development questions like that.

    That said, we always like helping out and at least point users into the right direction as much possible.

    The tribe_get_event_categories() function doesn’t allow a parent argument to be passed in order to only fetch specific child categories. You can try using the wp_get_post_terms() WordPress function that allows you to set a parent argument > https://developer.wordpress.org/reference/functions/wp_get_post_terms/

    I hope that helps. Let me know if you have any follow up questions.

    Best,
    Victor

    #1404662
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Display child category of parent in single-event.php’ is closed to new replies.