Skip Navigation

[Resolved] Using "The Events Calendar"

This support ticket is created 6 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 9 replies, has 2 voices.

Last updated by Yannis Sintos 6 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#1133797

Hello, I am using The Events Calendar im my website (along with Toolset of course).
I am trying to create a View with the list of forthcoming events.
Is there a way to have access to the title, the excerpt and the main description of an event, to display them in the view ?

Thank you

#1134050

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - when you set your view to display the events post type - you can display the post title using shortcode [wpv-post-title]
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-title

and post body using shortcode [wpv-post-body view_template="None"]
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body

For post excerpt - [wpv-post-excerpt length="30" count="word" more=" - ..."] :
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-excerpt

#1134055

Ok i will try this and let you know of the outcome.

One more question. Is it possible somehow to display events that are in the future? I mean can i create a filter in the view to have only the posts that have a date field and this field is from "now" and in the future ?

#1134198

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes, you can filter your view for future evernts but I need to know here that which date field you want to compare? Is it created using Types or its Events Calendar date field?

#1134200

Its Events Calendar date field "_EventStartDate", which i will use to diplay only the future events and not the past ones.

I also have a second question...
I am also trying to display this date and the "_EventEndDate" field with the following code:
<p>[wpv-post-field name="_EventStartDate" format="j F Y - H:i"] έως [wpv-post-field name="_EventEndDate" format="j F Y - H:i"]</p>
And my problem there is that the formatting i am trying to make is not working.
Should i use the [wpv-post-field] shortcode or should i use the [types] shortcode to display them?

#1134209

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - [wpv-post-field] does not have the format attribute. With Events Calender the event start date is stroed _EventStartDate field which is a date string.

To format the date of your event, please try to add the following shortcode to your current theme's functions.php file:

function func_date_format($atts) {
        global $post;
    $format = $atts["format"];
    $date = $atts["date"];
    if($format=='timestamp'){
           return strtotime($date);
     }else{
       return date($format, strtotime($date));
   }
}
add_shortcode("date-format", "func_date_format");

And call the shortcode as given under:

[date-format date='[wpv-post-field name='_EventStartDate']' format='j F Y - H:i']
#1134211

What if i use [types] shortcode ?

#1134212

Is there a reference for [types] as this one (https://toolset.com/documentation/user-guides/views-shortcodes/) for VIews ?

#1134231

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - You can use the format attribute when you created date type custom field using Types.

You can find all available field types with examples with the following link:
=> https://toolset.com/documentation/customizing-sites-using-php/functions/

#1135726

My issue is resolved now. Thank you!