WP Calendar
Maybe you can add this tip in FAQ (how to hide event widget) (5 posts)

  1. amagnier
    Posted 3 years ago #

    I needed to hide the widget if there was no event to have no "ugly" empty block in my website.

    It's not so difficult :

    1. Install and activate extension "Widget Logic Visual"

    2. Edit function.php in wordpress install directory and add at the end :

    function has_calendar_events() {
        if ( count( fse_get_events(array()) ) > 0 ) {   // test to see if there are some events to display
            return true;
        } else {
            return false;

    3. Then use "Edit Limitation" in the widget options. Select "Using Conditional Tag Code ( Advanced )".
    Fill conditional code with value :
    And tick "activate code".


  2. dsg257
    Posted 3 years ago #

    nice very useful thanks

  3. faebu
    Plugin Author

    Posted 3 years ago #

    Thank. I just added your solution to the FAQ!

  4. dsg257
    Posted 3 years ago #

    was using Widget Logic Visual with the above code but the plugin is incompatable with wordpress 3.5 widget areas wont open

  5. dsg257
    Posted 3 years ago #

    use widget logic instead works
    widget logic

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic