Need to conditionally target Event Category

WordPress Event Management, Calendars & Registration Forums General Question Need to conditionally target Event Category

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 10 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8957

    Hi!
    I want to edit my widget-event-list.php template to have a message after the loop:

    See all Workshops
    See all Classes

    But I need the phrase to show up conditionally depending on the category I’ve selected to display in the widget configurations.

    Is there an eo template tag to accomplish this?

    Thanks!

    Alicia St Rose
    #8963

    So the widget is set to show only a specific category and at the bottom you want a link to say ‘Show all [category]’?

    The following should do that:

    if( $eo_event_loop->is_tax( 'event-category' ) ){
        $cat = $eo_event_loop->get_queried_object();
        printf(
            'Show all <a href="%s">%s</a>',
            get_term_link( $cat, 'event-category' ),
            $cat->name
        );
    }

    I’m not sure what happens if multiple categories are selected though…

    Stephen Harris
    #8969

    Awesome!
    That worked. Fortunately, I’m only dealing with one category at a time.

    Thanks so much!
    LOVE, LOVE, LOVE the plugin.

    Do you have a gallery of sites using your plugin? I’d love to share my last project.

    Alicia St Rose
    #8993

    You’re welcome :).

    Not yet, but I’m in the process of gathering sites. So if you’d like yours to be included please drop an e-mail here: http://http://wp-event-organiser.com/contact, and that’ll be very much appreciated (always great to see how the plug-in is being used).

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.