Passing a template's category to the tribe_events_list shortcode

Home Forums Calendar Products Events Calendar PRO Passing a template's category to the tribe_events_list shortcode

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1568420
    Teresa Rickard
    Participant

    Hello!

    I have read and tried the advice at the following topic: https://theeventscalendar.com/support/forums/topic/passing-a-category-filter-to-the_widget/,

    however, I’m wondering if there’s a simple way to get pass a page’s category into the shortcode:

    ` <?php

    echo do_shortcode( ‘[tribe_events_list category=”dental” limit=”4″]’ );

    ?>

    and instead of “dental” I want the category to equal the category of the Page I’m on (i.e. category=”dental” on the Dental page; category=”construction” on the Construction page). and I want to do this at the Template level, so that it is automatic.

    Thank you SO much for any help you can provide.

    #1568724
    Cliff
    Member

    Hi. We can’t provide such a customization, per our Scope of Support / Terms.

    Please reference https://theeventscalendar.com/knowledgebase/embedding-calendar-views-tribe_events-shortcode/ for the shortcode arguments (also note there is no “limit” argument), and let me know if you have any follow-up questions on this topic.

    #1568737
    Teresa Rickard
    Participant

    There’s no limit argument for tribe_events_list? I don’t want a full calendar, just a list of events on different pages with different categories (as is attached).

    #1568769
    Teresa Rickard
    Participant

    Hey, I figured it out!

    This is what I was looking for:

    echo do_shortcode( ‘[tribe_events_list category=”‘ . get_the_title() . ‘” limit=”4″]’ );

    #1568830
    Cliff
    Member

    Oh, whoops, my mistake. I saw “tribe_events” but you did say “tribe_events_list” — good catch!

    The event category archive views should already be displaying their upcoming events. Is this not working for you?

    #1569495
    Teresa Rickard
    Participant

    I figured it out. This is what I was hoping to accomplish and it works great:

    echo do_shortcode( ‘[tribe_events_list category=”‘ . get_the_title() . ‘” limit=”4″]’ );

    #1569585
    Cliff
    Member

    OK. Glad to hear and thanks for letting us know.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Passing a template's category to the tribe_events_list shortcode’ is closed to new replies.