List of Categories

Home Forums Calendar Products Events Calendar PRO List of Categories

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #15483
    Nicholas
    Participant

    I’m trying to create a list of categories in a sidebar next to the event list. Users would be able to filter the event list by category that way. I just can’t seem to find the template tag for categories. Thanks

    #15535
    Rob
    Member

    Hey Nicholas. Thanks for the note. Have you checked out our template tag documentation (at https://theeventscalendar.com/support/documentation ) to see if it points you in the right direction? Let me know if not and I can get a dev to take a look here.

    #15554
    Nicholas
    Participant

    I used tribe_meta_event_cats( ) but only returned one category. I’m not quite sure what to include to get a list of all categories.

    #15570
    Rob
    Member

    Ah, gotcha. Thanks for confirming – let me see if our dev Jonah has any ideas here when he hits the forums today. Stay tuned.

    #15597
    Jonah
    Participant

    Hey Nicholas, categories are taxonomy terms in our plugin so you can use the WordPress get_terms function to pull all the categories like so:

    $terms = get_terms("tribe_events_cat");
    $count = count($terms);
    if ( $count > 0 ){
    echo "";
    foreach ( $terms as $term ) {
    echo "slug . "'>" . $term->name . "";

    }
    echo "";
    }

    That should point you in the right direction but let me know if you have any other questions on this.

    – Jonah

    #15601
    Nicholas
    Participant

    Ok, I’m getting closer.
    My end goal is to have an unordered list of Category links in my sidebar. I’m able to pull in the term name’s but not the links themselves, and using the term name’s in the links doesn’t work because of the spaces. I apologize, I’m new to php, and I’m probably missing something really obvious here.

    0 ){

    echo "";

    foreach ( $terms as $term ) {

    echo "name . "'>" . $term->name . "";

    }

    echo "";

    }

    ?>

    #15602
    Nicholas
    Participant

    disregard that snippet.
    that did not work how I hoped

    #15656
    Rob
    Member

    Hey Nicholas, if you’re trying to display code, it may be easiest to do so using pastie.org or a similar service, then just drop in the link so we can review from there. Apologies for the inconvenience on this end.

    #16752
    Nicholas
    Participant

    Still having trouble with this. here’s what I’ve gotten so far:

    #16753
    Nicholas
    Participant
    #16824
    Rob
    Member

    Hey Nicholas. We can take another look, but what element of the problem remains? Is it the entire issue as described in your previous post or have you made progress? Let me know.

    #17147
    Nicholas
    Participant

    Thanks Rob.
    Its made progress in that I used Jonah’s response to pull in the term names into a list. My goal is that each item of the list is a link to sort the events by categories (taxonomies, basically).
    I was trying to use the same term name code to pull in the link url, but that did not work for me.

    #17148
    Nicholas
    Participant

    I found the solution! I was using term name where I should have been using term slug

    #17187
    Rob
    Member

    Ah, excellent to hear! Glad that you’ve got this figured out, Nicholas. It sounds like you’re all set here but let me know if you need anything else down the road and we’ll do what we can to assist.

    #976402
    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 15 posts - 1 through 15 (of 15 total)
  • The topic ‘List of Categories’ is closed to new replies.