Forum Replies Created
-
AuthorPosts
-
June 22, 2017 at 6:34 am in reply to: Previous/Next month events show in Current month view #1301662
Thomas
ParticipantYes of course I won’t risk changing the plugin core files !
Thanks a lot, again 🙂June 22, 2017 at 1:22 am in reply to: Previous/Next month events show in Current month view #1301569Thomas
ParticipantHello 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 ?
June 22, 2017 at 12:26 am in reply to: Previous/Next month events show in Current month view #1301555Thomas
ParticipantHi 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 !
May 24, 2017 at 7:46 am in reply to: Cannot set property ‘date’ of undefined (Mini calendar on Month view) #1288296Thomas
ParticipantHi 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 !
-
AuthorPosts
