Forum Replies Created
-
AuthorPosts
-
Iris Suarez
Participantactually, i put back the original widgets.php file inside src/functions/template-tags, and if you look here:
https://cupertinotoday.com/every day in the mini calendar is still failing that conditional and returning the:
$html = ‘<span class=”tribe-mini-calendar-no-event”>’ . $day[‘daynum’] . ‘</span>’;
this is specifically what I believe our problem is. we have plenty of events:
http://cupertinotoday.com/?post_type=tribe_events or you can check the hidden list below the mini calendar (client request to hide).Is it possible for you to help us figure out why:
if ( $day[‘total_events’] > 0 )is returning false?
Thanks!
Iris Suarez
ParticipantThanks. Do you know why the conditional check for:
if ( $day[‘total_events’] > 0 )
is going right to the else statement (returning the <span class=”tribe-mini-calendar-no-event”>)?
I changed the class on the link back to class=”tribe-mini-calendar-day-link”, but it didn’t have an effect.
if ( $day['total_events'] > 0 ) { // there are events on this day if ( $args['count'] > 0 ) { // there is an event list under the calendar $html = '<a href="#" data-day="' . $day['date'] . '" class="tribe-mini-calendar-day-link">' . $day['daynum'] . '</a>'; } else { // there are no events under the calendar if ( tribe_events_is_view_enabled( 'day' ) ) { // day view is enabled ob_start(); tribe_the_day_link( $day['date'], $day['daynum'] ); $html = ob_get_clean(); } else { // day view is disabled, just show that there are events on the day but don't link anywhere $html = '<a href="javascript:void(0)">' . $day['daynum'] . '</a>'; } } }Iris Suarez
ParticipantHi Barry, can you tell me why the change in the link class change would impact the javascript?
ie, why would
class=”tribe-mini-calendar-day-link”
be ok and
class=”tribe-mini-calendar-day-link-NEW”
cause an issue with the JS?it doesn’t seem that it is even getting to that line in the function, but instead, failing the conditional
if ( $day[‘total_events’] > 0 )and outputting the span tag with the no events class in it.
I’m not sure why I changed the class, I will look into it, and it was probably just so I knew the file I was updating was actually the one in use, and I just left it there.
How would you recommend I overwrite the function without modding the core plugin. Can I add the function to functions.php in the theme being used?
Thanks!
-
This reply was modified 8 years, 7 months ago by
Iris Suarez.
-
This reply was modified 8 years, 7 months ago by
Iris Suarez.
Iris Suarez
ParticipantSure, here is a pastebin of the function:
Please let me know if there is any other info you need to help, thanks!
-
This reply was modified 8 years, 7 months ago by
-
AuthorPosts
