Removing Date from tribe-event-date-start and "-st", "-nd", & "-rd"

Home Forums Calendar Products Events Calendar PRO Removing Date from tribe-event-date-start and "-st", "-nd", & "-rd"

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1320267
    Brian Schneider
    Participant

    Hi – 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?

    #1320836
    Andras
    Keymaster

    Hello 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,
    Andras

    #1320865
    Brian Schneider
    Participant

    Hi 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

    #1321120
    Andras
    Keymaster

    Hello 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?

    #1321395
    Brian Schneider
    Participant

    Hi 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

    #1322063
    Andras
    Keymaster

    Hi,

    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

    #1332195
    Support Droid
    Keymaster

    Hey 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Removing Date from tribe-event-date-start and "-st", "-nd", & "-rd"’ is closed to new replies.