Problem next/previous month (april)
-
Hi,
I had a problem with not having the previous and next month.
After searching in this forum I found a fix that partially worked for me.
I’m using the following code in my functions.php/** * 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 '<a data-month="' . $date . '" href="' . $url . '" rel="next">' . $text . ' <span>»</span></a>'; } 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 '<a data-month="' . $date . '" href="' . $url . '" rel="prev"><span>«</span> ' . $text . ' </a>'; } } new ContinualMonthViewPagination; }Now I see the next/previous links, accept if I’m on march 2019, I don’t see the next link for April. If I go back on year for example march 2018 I can see the next month April, or if I go forward one year: march 2020 I can see the next April link.
How does is come that for 2019 I can’t see the next link? I have no errors in the console log. If I look into the source code, I see that the anchor link doesn’t exist in the list.
I’m running the latest wordpress version (Dutch) and latest plugin.
Hope you can help me out.
Regards,
Arno
The topic ‘Problem next/previous month (april)’ is closed to new replies.