Adding the event start/end time under the title in the monthly view

Home Forums Calendar Products Events Calendar PRO Adding the event start/end time under the title in the monthly view

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #71024
    gracesupplies
    Participant

    Hi, 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.

    #71097
    Barry
    Member

    Hi 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!

    #71101
    gracesupplies
    Participant

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

    #71108
    Barry
    Member

    Assuming 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!

    #71129
    gracesupplies
    Participant

    Hi,
    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

    #71131
    gracesupplies
    Participant

    That’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

    #71141
    Barry
    Member

    Sharing 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!

    #71142
    gracesupplies
    Participant

    See link: http://pastebin.com/XFqH9wNf

    I wish to have the date been shown under the title tag of that event.

    #71164
    Barry
    Member

    OK – 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!

    #981433
    Support Droid
    Keymaster

    This 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.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Adding the event start/end time under the title in the monthly view’ is closed to new replies.