Home › Forums › Calendar Products › Events Calendar PRO › Style the date items seperately
- This topic has 5 replies, 2 voices, and was last updated 7 years, 9 months ago by
lichtermeer.
-
AuthorPosts
-
June 22, 2018 at 3:31 am #1559027
lichtermeer
ParticipantIn list view i get the following html code for the Date:
<div class=”tribe-event-schedule-details”>
<span class=”tribe-event-date-start”>Samstag, 21. Juli 2018 von 14:00</span> – <span class=”tribe-event-time”>16:00</span> </div>
I want to style parts of the date seperately like the day “Samstag” larger and the year smaller. Can I have additional span-Tags around parts of the date?June 22, 2018 at 9:43 pm #1559751Geoff B.
MemberGood evening Andre and welcome back!
Thank you for reaching out to us.
I would love to help you with this topic.Can I have additional span-Tags around parts of the date?
Absolutely. In fact, you can customize each view exactly to your liking.
The way to achieve this is through template overrides (making a copy of the view files, changing them and uploading them in your WordPress theme’s folder).You might want to read our Themer’s guide to get a sense of how that works.
Let me know how that goes.
Best regards,
Geoff B.June 24, 2018 at 6:27 am #1560224lichtermeer
ParticipantHi,
as far as I can see is the whole date including time outputted by
<?php echo tribe_events_event_schedule_details() ?> in the single-event.phpI cannot see any way to seperately style parts of “tribe_events_event_schedule_details()” like only the year. But thats exactly wthat i want to do.
Dennis
June 25, 2018 at 9:46 pm #1561313Geoff B.
MemberGood evening Dennis,
Thank you for writing back.
You are absolutely right. My bad.
This specific function lives in /the-events-calendar/src/functions/template-tags/general.phpThis means that you have 2 options:
- Modify that function to your liking via your theme’s functions.php
- Simply replace that call by a modified version of the code found in general.php
Let me know how that goes.
Best regards,
Geoff B.June 30, 2018 at 1:15 am #1565082lichtermeer
ParticipantHi Geoff, I have no clue what to do in this files. The out put right now is:
<span class=”tribe-event-date-start”>Samstag, 21. Juli 2018 von 14:00</span> – <span class=”tribe-event-time”>16:00</span>
What I need is:
<span class=”tribe-event-day”>Samstag,</span> <span class=”tribe-event-date”>21. Juli</span> <span class=”tribe-event-year”>2018</span> <span class=”tribe-event-connector”>von</span> <span class=”tribe-event-time”>14:00</span><span class=”tribe-event-connector”> – </span> <span class=”tribe-event-time”>16:00</span>
Can you send me a code-snippet to include?
July 2, 2018 at 11:07 am #1566151Geoff B.
MemberGood afternoon Dennis,
Thank you for writing back.
Just to set expectations, the scope of our support is mostly to get our customers started on the right track and to help them in case of issues.
We, unfortunately, do not provide complete support for customization.
With that in mind, the simplest approach is the following:
- Head over to /the-events-calendar/src/functions/template-tags/general.php and copy the code from lines 1022 to 1041
- Paste the code in your theme’s functions.php file
- Rename the function tribe_events_event_schedule_details_customspan in your theme’s functions.php file
- Navigate the freshly added code to locate all the “$inner” lines and add your own spans in the mix
To finalize this:
- Head over to /wp-content/plugins/the-events-calendar/src/views/list/single-event.php and download the file
- Open the file and replace the call to echo tribe_events_event_schedule_details() by echo tribe_events_event_schedule_details_customspan()
- Upload the modified file back to [your-theme]/tribe-events/list/single-event.php
Let me know how that goes.
Best regards,
Geoff B.July 24, 2018 at 9:35 am #1582418Support 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 ‘Style the date items seperately’ is closed to new replies.
