I'm using types and views to show a list of events by the Tribe Events plugin, which is working perfectly fine.
What I'm trying to do now is show both the start and and dates of the events, but only for the events spanning more than 1 day.
My views code is currently as follows:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
<div class="event-card-container">
<div class="event-image">[wpv-post-featured-image size="medium"]</div>
<div class="event-content-box">
<div class="event-title">[my-title length="46"]</div>
<div class="event-date">[tribe-start-date]</div>
<div class="event-category">[types field='category-image' title='%%TITLE%%' alt='%%ALT%%' size='full'][/types]</div>
<div class="w-btn-wrapper width_auto align_center"><style>@media(max-width:600px){.us_btn_1{font-size:16px!important}}</style>Read More / Book</div>
</div>
</div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
<div class="pagination-feed-section">[wpv-pager-nav-links output="bootstrap"]</div>
[wpv-layout-end]
================================================================
In addition to this, I also have a custom code with the following:
<?php
/**
* New custom code snippet.
*/
toolset_snippet_security_check() or die( 'Direct access is not allowed' );
add_shortcode('tribe-start-date', 'tribe_start_date_shortcode');
function tribe_start_date_shortcode() {
global $post;
return tribe_get_start_date( $post->ID, false, 'l dS F Y' );
}
================================================================
Ideally in the views, I would have the text display on the frontend as:
Friday 22nd November to Friday 30th November 2019 (again, only for events spanning for more then one day). For the events that are a single day it can simply display as: Friday 22nd November
Can you let me know how I would go about integrating this?
Many thanks