Home › Forums › Calendar Products › Events Calendar PRO › Removing Date from tribe-event-date-start and "-st", "-nd", & "-rd"
- This topic has 7 replies, 2 voices, and was last updated 8 years, 9 months ago by
Brian Schneider.
-
AuthorPosts
-
July 12, 2017 at 3:25 pm #1320267
Brian Schneider
ParticipantHi – really enjoying Events Calendar! I am using the [tribe_this_week layout=”vertical”] shortcode on a page and had a couple of formatting questions (screenshot attached).
– for the date that I’m using to categorize the events, how can the “-st”, “-th” and “-rd” be removed after the number (ex. “3rd”, should be “3”)? I’ve already gone into Events>Settings and changed “Date without year” to “F j”.
– In the tribe-event-date-start field, is there a way to remove the date and just show the time?
– When creating an event, Is there a way to display the text from the text box instead of the title?
July 13, 2017 at 1:54 pm #1320836Andras
KeymasterHello Brian,
Happy to hear you like our plugins!
Thanks for getting in touch. I’ll try to help you with your questions.
for the date that I’m using to categorize the events, how can the “-st”, “-th” and “-rd” be removed
The formatting of this date doesn’t come from any setting you can easily modify.
You will need to create a template override, for that you can find more info in our Themer’s Guide. The override needs to be done for this file:
wp-content\plugins\events-calendar-pro\src\views\pro\widgets\this-week\loop-grid-day.php
You will have to change line 20 from this:
<span class="date"><?php echo esc_html( $day['formatted_date'] ); ?></span>to this:
<span class="date"><?php $new_date = date_create( $day['date'] ); echo date_format( $new_date, 'j' ); ?></span>In the tribe-event-date-start field, is there a way to remove the date and just show the time?
Yes. I believe you are talking about the list view. So you will need to create a template override for this file:
wp-content\plugins\the-events-calendar\src\views\list\single-event.php
When creating an event, Is there a way to display the text from the text box instead of the title?
I’m not quite sure what you mean by this. Can you please explain in a bit more detail? (I have a hunch this can also be done with a template override. 😉 )
Cheers,
AndrasJuly 13, 2017 at 2:37 pm #1320865Brian Schneider
ParticipantHi András,
Thank you for your response and help!
I was able to do a template override for loop-grid-day.php and get that working.
For the second issue, I’ve created a template override for single-event.php. I know the issue lives in <div class=”duration”><span class=”tribe-event-date-start”>July 13 @ 8:00 am</span></div>. In the screenshot I attached in the original post, July 13 has two posts and the “tribe-event-date-start” displays both the date and time (ex. July 13 @ 8:00 am). I need to remove the date so it would just display “8:00 am”. Can that be done in single-event.php or does it require a change in functions.php?
For the last issue, when displaying <class=”entry-title summary”> it seems to pull from the WordPress Events title field. Is it possible to change that so instead it pulls from “wp-editor-area”?
Thanks again for all your help!
-Brian
July 14, 2017 at 2:57 am #1321120Andras
KeymasterHello Brian,
For the second question, you should be able to influence the date format settings under
Events > Settings > Display, and WordPress time formats (via the General Settings admin screen).For the third question, if I understand correctly, you would like to display the long event description on the list view, instead of the event title?
If that is the case, then you should be able to do that with the single-event.php override. Just replace
the_title()(line 30) with something like this:echo tribe_events_get_the_excerpt( null, wp_kses_allowed_html( 'post' ) );(line 83)Is this good?
July 14, 2017 at 11:03 am #1321395Brian Schneider
ParticipantHi András,
Thanks again for your help.
I went into Events > Settings > Display and I deleted the text in the “Date without year” and “Date time separator” fields. Is that the ideal way to do this or is there a way to do this with code?
For the single-event.php, the one that I’m using is in /tribe-events/pro/widgets/this-week/single-event.php which only has 29 lines in the whole file. I think I need to change something in this line: <?php echo get_the_title( $event->ID ); ?>. I tried putting your code in there, but it didn’t work.
Any other thoughts? Thank you again for your patience and help!
-Brian
July 17, 2017 at 6:00 am #1322063Andras
KeymasterHi,
Going through the settings is the easier way for sure. It could also be done with a custom code but definitely more complicated.
For the single-event.php override, I’m sorry, I wasn’t thinking about the this week widget. For that you will likely need to replace get_the_title() with get_the_content() I’d say. That is a WordPress call.
Give that one a try.
Andras
August 8, 2017 at 9:35 am #1332195Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Removing Date from tribe-event-date-start and "-st", "-nd", & "-rd"’ is closed to new replies.
