Posted: September 21, 2015 at 7:09 am
|
Hi I have one event on a single day that has 17 Datetimes. Essentially 17 time slots of 30minutes from 12:00 to 20:00. By default the calendar shows all Datetimes with Event title : Datetime. I have worked out how to edit EE_Datetime_In_Calendar.class.php to show only the Event title for each Datetime but what I’d really like is just a single title for the whole event. The Event list seems to work this way but I can’t work out how to amend the above class to display just the title. Any suggestions as to where to look would be much appreciated. |
September 21, 2015 at 10:19 am Hi, those customizations would be lost when you update the events calendar. Could you provide a link to events calendar page? I think you are referring to the datetimes that are shown below the description in the tooltip. — |
|
|
September 21, 2015 at 10:25 am Hi This is a test site: Look at 20th September or 25th November. I realise the changes would be overwritten but I am happy to keep on top of that if necessary. |
Hi there, We’ll need to add at least one filter hook to the calendar to allow for modifying the query, but in the meantime, you can change the shortcode to be:
This will make it so it only displays the one event on the single day. |
|
Hi, The filter hook has been added and it’s included in the latest calendar add-on update. There’s some example code that you can add to a functions file that will alter the query so it will display one datetime for the event in a day. Here’s a link to that example code: |
|
|
Fantastic, thank you I will try it out right now! |
|
Hi I am getting a fatal as follows if I try the example code. PHP Fatal error: Call to undefined function array_column() in /removed-path/wp-content/themes/genesis-sample/functions.php on line 160, referer: http://kenningtonx.staging.wpengine.com/event-calendar/ |
Hi there, It turns out that array_column() is a function that was added in PHP 5.5. When you’re running a version of PHP that’s lower than 5.5, it will result in the fatal error you saw. To fix, you either update your server to run PHP 5.5 or copy and paste this fallback function into your functions file: https://github.com/ramsey/array_column/blob/master/src/array_column.php |
|
|
Thanks Josh That snippet is working perfectly now we have upgraded to PHP 5.5 however it shows the time of the first EventTime not just the Event title which is a bit misleading. Is it possible to amend the snippet to only output the event title? Thanks for your help. |
In this case you would not amend the snippet. You can make the calendar only display the Title by going into the calendar’s settings and you set Show Event Time in Calendar to No. |
|
|
I’m sorry it isn’t the Event Time having looked more closely, it is the name of the Event and then the name of the first Event Datetime separated by a colon : So it shows “Event Name : Event Datetime Name” Is it possible to amend it to show only “Event Name”? Thanks |
Yes, you remove the first datetime’s name in the event editor if you do not want that to be displayed. It’s an optional field. |
|
|
So simple when you know how… thank you for your patient support. |
You’re welcome. |
|
The support post ‘Show Event title once on calendar (no Datetimes required)’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.