Replace default divs in event listings
The Theater for WordPress plugin wraps all fields inside a element by default. But what if you want to use another element to wrap your field?
/** * Replaces the default divs around the event title in all event listings. * * @param string $html The current HTML for the event title. * @param WPT_Event $event The current event. * @return string The new HTML for the event title. */ function replace_event_title_divs($html, $event) { return '<h1><a href="'.$event->permalink().'">'.$event->title().'</a></h1>'; } add_filter('wpt_event_title_html','replace_event_title_divs', 10, 2); /** * Replaces the default divs around the event address in all event listings. * * @param string $html The current HTML for the event custom field. * @param string $field The name of the current custom field. * @param WPT_Event $event The current event. * @return string The new HTML for the event custom field. */ function replace_event_address_divs($html, $field, $event) { return '<div class="address">'.$event->custom('address').'</div>'; } add_filter('wpt_event_address_html','replace_event_address_divs', 10, 3);