Hide no events content

Home Forums Calendar Products Events Calendar PRO Hide no events content

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1156475
    Colin
    Participant

    Most of the time our events page will have no events. We have copy on the page to explain this. We need to remove the “No matching events listed under “category name here”. Please try viewing the full calendar for a complete list of events.” stuff when there is no content. How do we do that?

    #1156480
    Geoff
    Member

    Hi Hilary, happy Friday!

    Adding this to your theme’sĀ style.css file or using the Simple Custom CSS plugin should do the trick:

    .tribe-events-notices {
    display: none;
    }

    Let me know if that does the trick! If it doesn’t for some reason, it would be awesome to see a screenshot of the notice and I can dig deeper from there. šŸ™‚

    Cheers!
    Geoff

    #1156492
    Colin
    Participant

    Got it

    /**
     * Clean up Event Notices()
     */
    function notice_filter($string) {
      return strpos($string, 'No matching events') === false;
    } 
     
    function tribe_the_notices($html, $notices) {
    	
      $notices = array_filter($notices, __NAMESPACE__ . '\\notice_filter');
    	
      $html        = ! empty( $notices ) ? '<div class="tribe-events-notices"><ul><li>' . implode( '</li><li>', $notices ) . '</li></ul></div>' : '';
      	
      return $html;
    }
    add_filter('tribe_the_notices', __NAMESPACE__ . '\\tribe_the_notices', 10, 2);
    • This reply was modified 9 years, 8 months ago by Colin.
    #1156538
    Geoff
    Member

    Beautiful!

    Thanks a ton for following up and sharing this. šŸ™‚

    I’ll go ahead and close this thread but please feel free to let us know if any other questions pop up and we’d be happy to help.

    Cheers and have a great weekend!

    Geoff

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Hide no events content’ is closed to new replies.