Widget error when there are no classes
-
I noticed an error in the Today’s Classes widget. On days where there are no classes, and the widget displays “No classes today”, all widgets below the TC widget, are loaded inside the TC widget area. It’s as if the TC widget isn’t closed off properly before the next widget is opened.
The fix is simple… If you are comfortable editing plugin code, find the Weekly Class Schedule plugin file named ‘wcs3_widgets.php’ and open it. From lines 52-56, you’ll find the following code:
if ( $schedule == FALSE ) {
$output .= '<div class="wcs3-no-classes">' . $no_entries_msg . '</div>';
echo $output;
return;
}
All you have to do, is add this line:
echo $args['after_widget'];to turn the code block into:
if ( $schedule == FALSE ) {
$output .= '<div class="wcs3-no-classes">' . $no_entries_msg . '</div>';
echo $output;
echo $args['after_widget'];
return;
}
I hope you find this useful 🙂
The topic ‘Widget error when there are no classes’ is closed to new replies.