Home › Forums › Calendar Products › Events Calendar PRO › List of Categories
- This topic has 14 replies, 4 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
February 21, 2012 at 10:29 pm #15483
Nicholas
ParticipantI’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
February 22, 2012 at 8:14 pm #15535Rob
MemberHey 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.
February 23, 2012 at 8:22 am #15554Nicholas
ParticipantI 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.
February 23, 2012 at 10:03 am #15570Rob
MemberAh, gotcha. Thanks for confirming – let me see if our dev Jonah has any ideas here when he hits the forums today. Stay tuned.
February 23, 2012 at 2:23 pm #15597Jonah
ParticipantHey 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
February 23, 2012 at 3:09 pm #15601Nicholas
ParticipantOk, 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 "";
}
?>
February 23, 2012 at 3:10 pm #15602Nicholas
Participantdisregard that snippet.
that did not work how I hopedFebruary 24, 2012 at 11:59 am #15656Rob
MemberHey 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.
March 14, 2012 at 7:39 pm #16752Nicholas
ParticipantStill having trouble with this. here’s what I’ve gotten so far:
March 14, 2012 at 7:40 pm #16753Nicholas
ParticipantMarch 15, 2012 at 3:39 pm #16824Rob
MemberHey 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.
March 26, 2012 at 8:24 am #17147Nicholas
ParticipantThanks 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.March 26, 2012 at 8:42 am #17148Nicholas
ParticipantI found the solution! I was using term name where I should have been using term slug
March 26, 2012 at 6:01 pm #17187Rob
MemberAh, 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.
July 6, 2015 at 5:00 pm #976402Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘List of Categories’ is closed to new replies.
