[resolved] Widget disappearing when no events listed (3 posts)

  1. delflux
    Posted 3 years ago #

    I noticed that the widget isn't active when no events are listed. How would we edit the widget to still display but instead of making the widget inactive have it display "No upcoming events"?


  2. Matthew
    Plugin Author

    Posted 3 years ago #

    There isn't an easy way to do this within the administrator - like many wordpress widget formats, if there is no content, the widget will not display. If you'd like to modify this behavior, alter your sidebar to check for content within the widget and display other content if none is found.

  3. delflux
    Posted 3 years ago #

    I figured out a solution. Just added an else statement to the widget function.

    else {
    echo $before_widget.$before_title.$instance['title'].$after_title;
    echo '<p>No upcoming events</p>';

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Event-O-Matic
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic