Thomas

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Previous/Next month events show in Current month view #1301662
    Thomas
    Participant

    Yes of course I won’t risk changing the plugin core files !
    Thanks a lot, again 🙂

    in reply to: Previous/Next month events show in Current month view #1301569
    Thomas
    Participant

    Hello again,

    I’ve managed to do what I wanted !
    I didn’t override or hook the main loop but I used 2 functions to get the current month that is displayed and the month of the current event in the loop.

    It works like this (in single-day.php) :

    $month_of_event = split(‘-‘,$day[‘date’])[0].’-‘.split(‘-‘,$day[‘date’])[1];
    $month_displayed = split(‘-‘,tribe_get_month_view_date())[0].’-‘.split(‘-‘,tribe_get_month_view_date())[1];

    <?php if($month_of_event == $month_displayed): ?>
    /// SOME HTML ///
    <?php tribe_get_template_part( ‘list/single’, ‘event’ ) ?>
    /// SOME HTML ///
    <?php endif; ?>

    It does what I want but do you think it’s the best solution or is it safer to override the month loop itself in functions.php ?

    in reply to: Previous/Next month events show in Current month view #1301555
    Thomas
    Participant

    Hi Barry,

    Thanks for your answer.
    Actually I didn’t do much except call the single-event.php from the list folder instead of the single-event.php from the month folder. I just changed the HTML in order to customize the CSS as intended.

    So you think the easiest option is to override/hook the “main” loop function to only take events that matches the current month ? Is it possible for you to show me this hook ?

    I’m going to search on my own and if I find anything before you answer I will let you know. Thanks a lot for your answer !

    Thomas
    Participant

    Hi Cliff,

    Thanks for your help. I managed to find the error as I switched themes and disabled all other installed plugins.
    It was my fault, by modifiyng the code in order to have a list in the month view instead of a calendar, I deleted the informations that needed to be sent to the Javascript/Json handling the mobile.php and tooltip.php (Even if I don’t use them it still calls the function).

    The code I deleted was this :

    class="<?php tribe_events_the_month_day_classes(); ?>" data-day="<?php echo esc_attr( isset( $daydata['daynum'] ) ? $daydata['date'] : '' ); ?>"
         data-tribejson='<?php echo tribe_events_template_data( null, array( 'date_name' => tribe_format_date( $daydata['date'], false ) ) ); ?>'

    From the loop-grid.php
    It is supposed to surround the single-event.php so I added a <div> with those parameters in order to solve the problem.

    Again, thank you for leading me the right way !

Viewing 4 posts - 1 through 4 (of 4 total)