Home › Forums › Calendar Products › Events Calendar PRO › Next Month Link Auto-hide
- This topic has 3 replies, 2 voices, and was last updated 11 years, 6 months ago by
Barry.
-
AuthorPosts
-
October 16, 2014 at 2:54 am #813855
ronanoleary
ParticipantHi,
Just wondering if there is a way to disable the auto-hide function for the “next month” link on month view in the case of there being no events actually listed for the next month. I sometimes have events listed for 2 months in the future but nothing for the month in between – so the absence of the next month link in this case makes navigation a little more awkward. Apologies if this question has been answered already. Thanks, Ronan.October 16, 2014 at 6:52 am #814126Barry
MemberHi there ronanoleary,
It shouldn’t hide the next month link unless there truly are no events in the future.
In other words, if you have events in October then nothing in November or December but you do have a further event in January, it will still let you cycle through the months as far as January (if that is when the furthest-in-the-future event within your calendar is taking place).
Are you experiencing something other than this/can you point me to an example?
Thanks!
October 16, 2014 at 6:56 am #814134Barry
Member…Just to add, if you want those links to display regardless you can try adding this snippet to your 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). */ 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 = TribeEvents::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 = TribeEvents::instance()->previousMonth( tribe_get_month_view_date() ); return '<a data-month="' . $date . '" href="' . $url . '" rel="prev"><span>«</span> ' . $text . ' </a>'; } } new ContinualMonthViewPagination;(If there’s a bug though and you’re not seeing the links appear when they should – ie, when there are future events – it would be awesome to see it first hand and potentially fix it as I can’t seem to replicate the same thing locally and we’d love to get a little more insight if it’s a bug that might impact others.)
Thanks again!
October 29, 2014 at 7:27 am #846632Barry
MemberHi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!
-
AuthorPosts
- The topic ‘Next Month Link Auto-hide’ is closed to new replies.
