Scroll between month without events on child theme

Home Forums Ticket Products Community Tickets Scroll between month without events on child theme

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1143132
    Alexander
    Participant

    I dont´t see the the previous and next month above/below the calendar.
    There are no events but I would like to have scroll option, anyway.
    I read about one solution, to add some lines of code to the functions file, but that won´t work on my (divi) child theme.

    Ant other solution?

    Thanks in advance

    #1143742
    Hunter
    Moderator

    Hey Alexander,

    We appreciate you choosing PRO and welcome to the premium forums! I just did a quick test of the snippet from our ‘Add Next/Previous links to empty months’ Knowledgebase article on my version of Divi (2.7.5) and it worked fine for me. (see screenshot below)

    Try adding the following code to the bottom of your theme’s functions.php file and visit your month view to see if it works properly. Let me know how it goes and thanks again for choosing PRO!

    /**
    * 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 . ' <span>»</span>';
    }

    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 '<span>«</span> ' . $text . ' ';
    }
    }

    new ContinualMonthViewPagination;

    }

    #1152144
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Scroll between month without events on child theme’ is closed to new replies.