When no events, template code produces closing ul tag
-
Hopefully this will save some people from pulling their hair out. I, on the other hand, am going bald.
When using the template code to list events in a theme, the code will output a closing ul tag when no events are available.
Why? I have no idea.Here’s the code I used to respond to an empty calendar:
<?php if (function_exists('scheduler_sidebar')) { $list_of_events = scheduler_sidebar(); if($list_of_events == '</ul>') {/* the scheduler plugin outputs a '</ul>' when there are no events */ $message = 'No events scheduled at this time'; echo ('<ul><li>'.$message'.</li></ul>'); } else { echo $list_of_events; //outputs an unordered list }}?>
- The topic ‘When no events, template code produces closing ul tag’ is closed to new replies.