Current Category

Home Forums Welcome! Pre-Sales Questions Current Category

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #24660
    Maurice
    Guest

    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?

    #24776
    Rob
    Member

    Hi 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.

    #24856
    Maurice
    Guest

    Hi 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.

    #24967
    Rob
    Member

    Maurice: 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?

    #25056
    Maurice
    Guest

    I’d just like to get the category name to use as a page title.

    #25233
    Maurice
    Guest

    The 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
    )

    #25234
    Maurice
    Guest

    It looks like the opening <php didn’t come through in that last post.

    #25529
    Leah
    Member

    Thanks for posting the code Maurice! I’ll bet another user will find that helpful.

    #977818
    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 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Current Category’ is closed to new replies.