Home › Forums › Calendar Products › Events Calendar PRO › Remove Recurring Info from List View
- This topic has 4 replies, 3 voices, and was last updated 9 years, 3 months ago by
Barry.
-
AuthorPosts
-
January 11, 2017 at 11:36 am #1216809
Kay
ParticipantI need to remove the recurring info from my list view. I did see a css solution posted in a couple threads
(https://theeventscalendar.com/support/forums/topic/how-to-remove-text-recurring-event-see-all-from-recurring-events/, https://theeventscalendar.com/support/forums/topic/recurring-event-text-appears-in-the-list-view/)
but I need it to be completely absent from the DOM.
I am using
<?php echo tribe_events_event_schedule_details(); ?>to display the date info for the event, but the recurring info is being inserted into it and modifying the markup of that whole area in a way that does not work with my theme.Is there a php filter I can use to remove this completely?
January 12, 2017 at 6:41 am #1217347Barry
MemberHi James,
Would a solution like this work for you?
function maybe_remove_rec_tooltip( $template ) { // Do not interfere if this isn't the list view if ( 'list/content.php' !== $template ) { return; } // Safety check, in case PRO has been deactivated if ( ! class_exists( 'Tribe__Events__Pro__Main' ) ) { return; } // Disabled recurrence tooltips Tribe__Events__Pro__Main::instance()->disable_recurring_info_tooltip(); // Restore once list view has finished rendering add_action( 'tribe_after_get_template_part', 'restore_rec_tooltip' ); } function restore_rec_tooltip( $template ) { // Do not interfere if this isn't the list view if ( 'list/content.php' !== $template ) { return; } // Disabled recurrence tooltips Tribe__Events__Pro__Main::instance()->enable_recurring_info_tooltip(); } add_action( 'tribe_before_get_template_part', 'maybe_remove_rec_tooltip' );(This could be added to a custom plugin or even to your theme’s functions.php file, though if the latter is not a custom theme you’d want to be wary of losing changes upon future updates.)
The idea is that it detects list view is being rendered, disables the recurrence tooltips, then restores them afterwards. If you prefer to disable them entirely, across all views and not just list view, you could use a similar – but simpler approach.
Does that help at all?
January 12, 2017 at 1:08 pm #1217653Kay
ParticipantThanks! That is useful. I didn’t need such a complex solution, so I ended up with just:
function bhass_remove_rec_tooltip( $template ) { Tribe__Events__Pro__Main::instance()->disable_recurring_info_tooltip(); }Works great : )
January 12, 2017 at 1:41 pm #1217683Barry
MemberAwesome!
-
AuthorPosts
- The topic ‘Remove Recurring Info from List View’ is closed to new replies.
