Change output markup of the list organizer shortcode to div

Home Forums Calendar Products Events Calendar PRO Change output markup of the list organizer shortcode to div

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1165946
    Josh
    Participant

    I’m using the list organizer/venue shortcode from the plugin The Events Calendar: List Venues/Organizers Shortcakes. Instead of having the organizers wrapped as list items, I’d like to have them wrapped in divs. Is there a filter available to do this?

    #1166123
    Nico
    Member

    Hi there Josh,

    Thanks for getting in touch! I can help you here 🙂

    Hopefully the Venue & Organizers shortcodes plugin comes packed with some handy filter to change the markup! Paste the snippet below in your theme theme’s (or child theme’s) functions.php file:

    /* Tribe, customize venue/organizer shortcodes markup (https://theeventscalendar.com/knowledgebase/listing-venues-and-organizers/) */

    function tribe_venue_organizer_list_change_opening_tag ( $opening_tag, $atts ) {

    $opening_tag = '<div class="tec list ' . $atts['post_type'] . '">';
    return $opening_tag;
    }

    add_filter( 'TEC_VenueOrganizer_List.list.open', 'tribe_venue_organizer_list_change_opening_tag', 10, 2 );

    function tribe_venue_organizer_list_change_closing_tag ( $closing_tag, $atts ) {

    return '</div>';
    }

    add_filter( 'TEC_VenueOrganizer_List.list.close', 'tribe_venue_organizer_list_change_closing_tag', 10, 2 );

    function tribe_venue_organizer_list_change_item_tag ( $item, $atts ) {

    $item = str_replace ( '<li', '<div' , $item );
    $item = str_replace ( '', '</div>' , $item );
    return $item;
    }

    add_filter( 'TEC_VenueOrganizer_List.list.item', 'tribe_venue_organizer_list_change_item_tag', 10, 2 );

    Feel free to modify as you see fits best your needs 🙂

    Cheers,
    Nico

    #1175002
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Change output markup of the list organizer shortcode to div’ is closed to new replies.