Home › Forums › Welcome! › Pre-Sales Questions › Current Category
- This topic has 8 replies, 3 voices, and was last updated 8 years, 8 months ago by Support Droid.
-
AuthorPosts
-
September 6, 2012 at 1:33 pm #24660MauriceGuest
I’ve been looking through the documentation and I can’t seem to find anything that allows you to display the name of the current category for a calendar view.
For example, if I’m at http://localhost/events/category/mycatname , how can the category name ‘mycatname’ be retrieved?September 10, 2012 at 1:12 pm #24776RobMemberHi Maurice. Thanks for the note here, and my apologies for taking a few days to get you a response on this end. Are you saying you just want the category name added to the breadcrumb navigation…or something more? When viewing a specific category loop on the frontend, the name of the category itself should already be in place…
Let me know…if you can clarify that point, I’ll do what I can to get you the appropriate response. Cheers and thanks for your patience so far.
September 11, 2012 at 5:14 pm #24856MauriceGuestHi Rob. I’d like to display the current category as part of a page title. That part about viewing “a specific category loop” is what I guess I need help understanding. I’ve found information on showing events in the post main loop. I’ve also found information on showing all categories. But, I can’t find anything that shows how to identify the current category on a calendar view page.
September 12, 2012 at 7:02 pm #24967RobMemberMaurice: do you just mean getting the breadcrumb nav in there, so you see something like: Site Title –> Calendar of Events –> (Category name) atop the page?
September 13, 2012 at 5:53 pm #25056MauriceGuestI’d just like to get the category name to use as a page title.
September 17, 2012 at 12:27 pm #25233MauriceGuestThe answer
get_event_taxonomy();
$eventCat = get_term_by( ‘slug’, get_query_var(‘term’), $tribeEvents->get_event_taxonomy() );
$eventCatName = $eventCat->name;
?>eventCat= stdClass Object
(
[term_id] => 9
[name] => Education
[slug] => education
[term_group] => 0
[term_taxonomy_id] => 20
[taxonomy] => tribe_events_cat
[description] =>
[parent] => 0
[count] => 2
)September 17, 2012 at 12:28 pm #25234MauriceGuestIt looks like the opening <php didn’t come through in that last post.
September 21, 2012 at 9:05 am #25529LeahMemberThanks for posting the code Maurice! I’ll bet another user will find that helpful.
July 7, 2015 at 6:26 am #977818Support DroidKeymasterThis 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 ‘Current Category’ is closed to new replies.