Home › Forums › Calendar Products › Events Calendar PRO › Remove Event Times only
- This topic has 14 replies, 2 voices, and was last updated 9 years, 9 months ago by Barry.
-
AuthorPosts
-
July 23, 2014 at 3:32 am #487663Philip MurrayParticipant
hi Guys
I bought the Events Calendar PRO and am having problems sorting out this specific request
I want the TIME not to be displayed for any event whether it is shown in the CALENDAR WIDGET or in the main Calendar page.
i added this class to my CSS
.tribe-events-abbr.updated.published.dtstart { display: none; }
but it removed the DATE as well as the TIME !!! so i removed the class again.if you look at http://www.fingerprintdigitalmedia.com/beaverstown/ the widget is in the right column. The Events are shown, each with a start time of 12am – which i want to either REMOVE or HIDE.
i want to keep the dates in but have the TIME removedsimilarly on the Event Detail pages:
http://www.fingerprintdigitalmedia.com/beaverstown/events/junior-comp-800-1100-9-hole-invitational-500-700-6/i want the TIME to be removed or HIDDEN
how do i do this in the CSS please?
thanks
Phil
July 24, 2014 at 8:22 am #497548BarryMemberHi Phil, thanks for contacting us.
if you look at http://www.fingerprintdigitalmedia.com/beaverstown/ the widget is in the right column. The Events are shown, each with a start time of 12am – which i want to either REMOVE or HIDE.
i want to keep the dates in but have the TIME removedIt looks like you’ve already resolved this part of the problem, is that correct?
similarly on the Event Detail pages:
http://www.fingerprintdigitalmedia.com/beaverstown/events/junior-comp-800-1100-9-hole-invitational-500-700-6/i want the TIME to be removed or HIDDEN
Again it looks like you have already achieved this – at least in one place – but I see the start time is still displaying within the meta section the area headlined Details, within a grey box. Do you also wish to remove that entry?
Thanks!
July 24, 2014 at 10:05 am #498237Philip MurrayParticipanthi Barry
yes – the problem resolved it for the CALENDAR WIDGET by adding this to the CSS:
.date-start.dtstart {
display:none !important;
}however it is not resolved for the EVENTS PAGE
this for example:
http://www.fingerprintdigitalmedia.com/beaverstown/events/friday-night-mixed-9-hole-500-700-8/i tried adding this to the CSS:
abbr.tribe-events-abbr.updated.published.dtstart {
display:none !important;
}but it removed both the DATE and the TIME — i only want the TIME to be removed completely [included the word Time: also]
thanks
Phil
July 25, 2014 at 6:16 am #505557BarryMemberOK, thanks for clarifying. Let’s use a different approach (than CSS) to remove the time from the string at the top of the single event pages. Please add the following snippet to your theme’s functions.php file:
add_filter( 'tribe_events_event_schedule_details', 'remove_schedule_details_time' ); function remove_schedule_details_time( $dt_string ) { // This approach relies on a fairly unique non-empty separator being set $separator = tribe_get_option('dateTimeSeparator', ' @ '); $split = strpos( $dt_string, $separator ); // If the split point can't be found, bail if ( ! $split ) return $dt_string; // Otherwise, return everything *up to* the split point return substr( $dt_string, 0, ++$split ); }
This does assume that you’ve got a separator symbol such as @ set up, which is the default behaviour. To remove the time from the meta section below, please first read through our Themer’s Guide which covers the basics of safely overriding and customizing our templates.
From there you will be interested in overriding the modules/meta/details.php template. Within your own copy locate this fairly lengthy section of code and reduce it to this (so your final custom template should basically look a bit like this).
Does that help?
July 25, 2014 at 6:32 am #505674Philip MurrayParticipantThanks a lot Barry – i will give it a try and report back
Phil
July 28, 2014 at 11:21 am #526979BarryMemberAwesome, look forward to hearing from you 🙂
August 8, 2014 at 8:06 am #616129Philip MurrayParticipanthi Barry
ok i tried adding your script to functions.php without success
here is a typical EVENT PAGE – the TIME is still visible
http://www.beaverstown.com/event/club-competition-31/i want the date to remain but the time to not be shown at all
the time is also visible on the main CALENDAR MONTH VIEW page
http://www.beaverstown.com/events/any idea why it didn’t work?
thanks
PhilAugust 8, 2014 at 3:54 pm #618303BarryMemberInteresting: can you confirm you put a template override in place (and let me know what it’s path is)? Could you also share the code you currently have within it?
August 8, 2014 at 11:11 pm #621631Philip MurrayParticipanthi Barry – thanks – it’s the override that I am going wrong on — i have the PRO version — where do i find the modules/meta/details.php template ? i checked via FTP but what i see is a folder called /events-calendar-pro/views/pro/modules/meta/additional-fields.php
thanks
PhilAugust 8, 2014 at 11:24 pm #621730Philip MurrayParticipanthi Barry
ok – i got it sorted – i needed to edit the details.php within the-events-calendar structure rather than the pro structure. So that is working fine now.
but one more change needed – if you look at the MONTH VIEW page for the category – http://www.beaverstown.com/events/category/club-diary/
if you hover over any event it shows the time of 12:00am in there — i need to remove that too pleasethanks
PhilAugust 10, 2014 at 12:28 pm #631720Philip MurrayParticipanthi Barry
as well as the point above – i have noticed another problem.
if you look at my client site – http://www.beaverstown.com/
in the right column i have shown the CALENDAR WIDGET — but if you select any of the dates which have a events in them – nothing gets shown below the calendar?any idea how to fix this?
thanks
PhilAugust 11, 2014 at 4:57 am #638162BarryMemberHi Phil!
if you hover over any event it shows the time of 12:00am in there — i need to remove that too please
So you’re going to need a further template override in place – this time for month/single-event.php – and the basic idea is to modify the data that is passed across to the tooltip such that the start time is stripped out. I’m going to assume here that you still have the function I suggested in my earlier reply in place.
Essentially, you need to add this code near the top of the file, but below the line reading global $post:
$tooltip_data = json_decode( tribe_events_template_data( $post ) ); $tooltip_data->startTime = remove_schedule_details_time( $tooltip_data->startTime ); $tooltip_data = json_encode( $tooltip_data );
Then, you need to find this short piece of code:
data-tribejson='<?php echo tribe_events_template_data( $post ); ?>'
Change this segment to:
data-tribejson='<?php echo $tooltip_data ?>'
(The complete custom template should basically look something like this.)
as well as the point above – i have noticed another problem.
if you look at my client site – http://www.beaverstown.com/
in the right column i have shown the CALENDAR WIDGET — but if you select any of the dates which have a events in them – nothing gets shown below the calendar?We’re happy to help if we can – but we do try to stick to one issue per thread. If you don’t mind posting a new thread for this unrelated issue one of the team will be only too happy to help 🙂
August 11, 2014 at 5:26 am #638343Philip MurrayParticipantThanks Barry – i will try this.
i also posted the other query as a separate thread
cheers
PhilAugust 11, 2014 at 5:43 am #638475Philip MurrayParticipanthi Barry
that code worked perfectly — is there anyway I can get rid of the ‘@’ symbol too please – which is visible when you hover over an event in MONTH VIEW
thanks
PhilAugust 11, 2014 at 12:12 pm #641279BarryMemberHi Phil,
I’m sorry that didn’t quite work for you. Interestingly, it does work for me and the @ symbol is removed. It might simply be that you need to tinker a little with the function I provided earlier to get the best results in your specific case – you might for instance want to increment or decrement the $split variable one or more times.
Unfortunately, I think at this point we’ll have to leave it to you to iron out the last few details. Thanks again for posting and good luck with the rest of the customization (and one of the team will be along to help in the other thread you created) 🙂
-
AuthorPosts
- The topic ‘Remove Event Times only’ is closed to new replies.