Home › Forums › Calendar Products › Events Calendar PRO › Previous and next month on mobile devices
- This topic has 4 replies, 2 voices, and was last updated 7 years, 9 months ago by
Rasmus.
-
AuthorPosts
-
June 19, 2018 at 1:27 am #1555921
Rasmus
ParticipantHi! I’m having trouble with the links to Previous and Next month on mobile devices when a monthly calendar is empty.
The buttons for previous/next months disappears on the months with an empty calendar. Even if there is an event during the following month, after the empty month, the buttons will not show on a mobile device.For example:
June – Have events – Prev/Next button is visible
July – Have no events – Prev/Next button is NOT visible
August – Have events – Prev/Next button is visibleIs this a common issue? How can it be solved?
June 19, 2018 at 7:23 am #1556119Edward
MemberHey Rasmus,
Thanks for reaching out!
The Events Calendar is actually designed to not show the previous/next month views when there are no events found in that month.
We understand that sometimes users may wish to override this setting and have provided a code snippet to do so. Just copy/past this into your child theme’s functions.php file:
/**
* Allows visitors to page forward/backwards in any direction within month view
* an "infinite" number of times (ie, outwith the populated range of months).
*/
if ( class_exists( 'Tribe__Events__Main' ) ) {
class ContinualMonthViewPagination {
public function __construct() {
add_filter( 'tribe_events_the_next_month_link', array( $this, 'next_month' ) );
add_filter( 'tribe_events_the_previous_month_link', array( $this, 'previous_month' ) );
}
public function next_month() {
$url = tribe_get_next_month_link();
$text = tribe_get_next_month_text();
$date = Tribe__Events__Main::instance()->nextMonth( tribe_get_month_view_date() );
return '' . $text . ' ยป';
}
public function previous_month() {
$url = tribe_get_previous_month_link();
$text = tribe_get_previous_month_text();
$date = Tribe__Events__Main::instance()->previousMonth( tribe_get_month_view_date() );
return 'ยซ ' . $text . ' ';
}
}
new ContinualMonthViewPagination;
}You can read more about this here โ https://theeventscalendar.com/knowledgebase/add-nextprevious-links/
I hope that helps you out. If you have any other questions, let us know!
Take care,
Ed ๐June 19, 2018 at 7:43 am #1556144Rasmus
ParticipantThanks for your reply erishel! I’m sorry but the code didn’t do any difference. Got any clues of why?
June 21, 2018 at 5:03 am #1558100Rasmus
ParticipantAny more ideas since the solution above didn’t solve the problem?
It is only on mobile devices the links to previous and next month disappears on calendar months without events.
June 22, 2018 at 2:22 pm #1559599Edward
MemberHey Rasmus,
Have you tried temporarily activating another theme like Twenty Seventeen? You can take a look at our Testing for Conflicts guide for more info on that.
That snippet normally resolves the issue, so I’m wondering if the plugin is being hampered by the theme, or possibly a plugin.
Let me know!
Ed ๐July 14, 2018 at 9:35 am #1575378Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Previous and next month on mobile devices’ is closed to new replies.
