Previous and next month on mobile devices

Home Forums Calendar Products Events Calendar PRO Previous and next month on mobile devices

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1555921
    Rasmus
    Participant

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

    Is this a common issue? How can it be solved?

    #1556119
    Edward
    Member

    Hey 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 ๐Ÿ™‚

    #1556144
    Rasmus
    Participant

    Thanks for your reply erishel! I’m sorry but the code didn’t do any difference. Got any clues of why?

    #1558100
    Rasmus
    Participant

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

    #1559599
    Edward
    Member

    Hey 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 ๐Ÿ™‚

    #1575378
    Support Droid
    Keymaster

    Hey 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Previous and next month on mobile devices’ is closed to new replies.