Home › Forums › Ticket Products › Community Tickets › Scroll between month without events on child theme
- This topic has 3 replies, 4 voices, and was last updated 7 years, 9 months ago by Alexander.
-
AuthorPosts
-
July 22, 2016 at 12:27 pm #1143132AlexanderParticipant
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
July 25, 2016 at 11:17 am #1143742HunterModeratorHey 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;
}
August 16, 2016 at 9:35 am #1152144Support DroidKeymasterThis 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. -
AuthorPosts
- The topic ‘Scroll between month without events on child theme’ is closed to new replies.