• Resolved mfuark

    (@mfuark)


    Okay so I’ve taken over the website maintenance for a company that owns a number of bars and restaurants.

    The current setup has Featured Events displayed on every page above the footer by including

    ‘<?php get_template_part(‘template-parts/global/upcoming-events’); ?>’

    in the Single Venue Template Page Template in
    theme files/template-parts

    What I am trying to do is filter the Featured Events displayed on each page by Venue.

    So my question is how do I go about this? I’ve looked into all of the short codes, I know what I need but I don’t know HOW to do it. I would like the Featured Events to remain displayed where they are, just above the footer.

    Problem is entering short code here only only results in printing the string literal. Any advice is welcomed. I’m fine with creating an if-else function somewhere if that’s what I need to do, I just have no idea where to put it.

    • This topic was modified 2 years, 2 months ago by mfuark. Reason: added wordpress site

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Abz

    (@abzlevelup)

    Hi @mfuark, that’s correct. It should be possible with a shortcode. See the snippet here:
    [tribe_events view="list" tribe-bar="false" featured="true"]

    One thing to note is that shortcodes are only available with the Pro version of the plugin. https://theeventscalendar.com/knowledgebase/k/embedding-calendar-views-with-the-tribe_events-shortcode/

    Let me know if this helps.

    Best,
    Abz

    Plugin Support Abz

    (@abzlevelup)

    Hey @mfuark, this thread has been inactive for a while, so we’re going to go ahead and mark it Resolved. Please feel free to open a new thread if any other questions come up, and we’d be happy to help.

    Cheers,
    Abz

    Thread Starter mfuark

    (@mfuark)

    hello

    I did manage to resolve the issue in the interest of helping others what I did was

    <?php
    // Switch Statement to display Events sorted by Venue on different location pages //

    global $wp;
    $current_slug = add_query_arg( array(), $wp->request );

    switch ($current_slug){
    case “locations/camelot”;
    echo do_shortcode(‘[tribe_events view=”photo” venue=”camelot”]’);
    break;

    default;
    $events = tribe_get_events( [
    ‘start_date’ => ‘today’,
    ‘end_date’ => ‘+1 week’,
    ‘posts_per_page’ => 5,
    ‘featured’ => true,
    ] );
    }
    ?>

    So pretty much the part I was looking for was the echo do shortcode bit. Also opted for a case statement as opposed to if else for speed

    • This reply was modified 2 years, 2 months ago by mfuark.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Displaying separate ‘featured events’ for different pages’ is closed to new replies.