Home › Forums › Calendar Products › Events Calendar PRO › Adding the event start/end time under the title in the monthly view
- This topic has 9 replies, 3 voices, and was last updated 10 years, 10 months ago by
Support Droid.
-
AuthorPosts
-
October 15, 2013 at 2:46 am #71024
gracesupplies
ParticipantHi, I hope you can help me.
I would like to show the start time and end time e.g. 0800 to 1430, under the text on the monthly calendar, is this possible, what code would I need to put in to make this work, I can then style it to fit etc..
Many thanks.
October 15, 2013 at 9:03 am #71097Barry
MemberHi gracesupplies,
There’s a great guide to getting started with customizations in the form of our Themer’s Guide and, in this case, you are probably going to want to customize month/single-event.php.
Perhaps you could repurpose some of the code from the event tooltip section (in that same template) such as tribe_events_event_schedule_details()?
Hope that helps!
October 15, 2013 at 9:23 am #71101gracesupplies
ParticipantHi Barry,
Thanks for getting back to me, I did indeed do some more digging and found tribe_events_event_schedule_details(), this did indeed work and was implimented into the single-even.php file, but it unfortunately shows the date as well as the time, I did look deeper into the function of this on line 729 in public/template-tags/general.php, but unfortunately my level of skills stop there and wouldn’t be comfy changing anything to get it to work, by looking in general.php, could I create another fuction which will easily grab the time for the event so it can be shown?October 15, 2013 at 9:55 am #71108Barry
MemberAssuming you’re within the loop (you should be here) you can grab the time only by doing something like:
$time = tribe_get_start_date(null, true, ' ');Or outwith a loop context you could pass in an explicit post ID (for the event you are interested in):
$time = tribe_get_start_date($post_id, true, ' ');Noting that the single space string in both the above examples is intentional (and will consequently provide the time according to your WordPress time format setting).
Hope that helps!
October 15, 2013 at 11:57 am #71129gracesupplies
ParticipantHi,
I’ve had a go with that, but I believe I may be doing something wrong as nothing is showing up, I’ve found a tutorial about this but still no luck. Below is where I am putting the code, could you advise?if ( !defined(‘ABSPATH’) ) { die(‘-1’); } ?>
ID}-{$day[‘daynum’]}”;
$start = tribe_get_start_date( $post, FALSE, ‘U’ );
$end = tribe_get_end_date( $post, FALSE, ‘U’ );?>
<div id="tribe-events-event-” class=””>
<a href="” class=”url”><div id="tribe-events-tooltip-” class=”tribe-events-tooltip”>
TIME HERE
October 15, 2013 at 12:04 pm #71131gracesupplies
ParticipantThat’s not posted right at all, it’s the single-event.php which i’m trying to place it just under the title in time-time
October 15, 2013 at 12:54 pm #71141Barry
MemberSharing code directly in the forum is, sadly, doomed to failure until we can implement some changes 🙂 … please share code by linking to it via a service like Pastebin or Gist instead!
October 15, 2013 at 1:00 pm #71142gracesupplies
ParticipantSee link: http://pastebin.com/XFqH9wNf
I wish to have the date been shown under the title tag of that event.
October 15, 2013 at 3:00 pm #71164Barry
MemberOK – but you’d need to obtain the start (and end times) using something like the code I provided earlier in the thread and then echo or print it, which you could do with something like:
<?php echo $time ?>(Assuming you’ve populated $time using something like I suggested above, of course.)
If you’re unfamiliar with PHP and customizing/theming WordPress in general I’d definitely recommend doing some background research on this first of all, as we are unable to implement customizations for you and can really only offer a nudge in the right direction.
Thanks – and good luck!
July 7, 2015 at 6:29 am #981433Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Adding the event start/end time under the title in the monthly view’ is closed to new replies.
