Title: Hide the empty event list
Last modified: March 28, 2020

---

# Hide the empty event list

 *  Resolved [iko47](https://wordpress.org/support/users/iko47/)
 * (@iko47)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/)
 * Hi, is it possible to hide the event list from the page when it’s empty (‘No 
   data available in table’)?
 * Many thanks

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [Roch](https://wordpress.org/support/users/rochesterj/)
 * (@rochesterj)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/#post-12595543)
 * Hi!
 * Thanks for reaching out.
 * We can do this with a bit of JS code.
 * Would you mind pasting the link to an example of this issue in your site, so 
   we can check it out?
 * Kind Regards,
    -Roch
 *  Thread Starter [iko47](https://wordpress.org/support/users/iko47/)
 * (@iko47)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/#post-12596217)
 * Hi, this is the link
    [https://www.tvinsport.it](https://www.tvinsport.it) The
   event list at the moment is only Serie A event list that I want to hide because
   there are “No data available”.
 * Many thanks
    Federico
 *  [Roch](https://wordpress.org/support/users/rochesterj/)
 * (@rochesterj)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/#post-12603706)
 * Hi!
 * Thanks for the link.
 * This is the JS code to do it:
 *     ```
       <script type="text/javascript">
       jQuery(document).ready(function($) {
       jQuery(".sp-event-list td").each(function(){
           var text = jQuery(this).text();
           if ( text == "No data available in table") {
               jQuery(this).parent().parent().parent().parent().hide();
           }
       });
       });
       </script>
       ```
   
 * You can add it to your site using a plugin like this one:
    [https://wordpress.org/plugins/header-and-footer-scripts/](https://wordpress.org/plugins/header-and-footer-scripts/)
 * Or add it directly in your theme files (header or footer).
 * Just keep in mind that this will not hide the title, as doing so will actually
   remove the entire post you have right now.
 * We have two options for this:
    1) Add a custom class to your titles so we can
   hide them easily via JS as well. 2) Add the titles via CSS (which will be harder).
 * The first one is probably easier and cleaner.
 * Thanks!
 *  Thread Starter [iko47](https://wordpress.org/support/users/iko47/)
 * (@iko47)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/#post-12607491)
 * Thank you very much Roch.
    -  This reply was modified 6 years, 2 months ago by [iko47](https://wordpress.org/support/users/iko47/).
 *  Thread Starter [iko47](https://wordpress.org/support/users/iko47/)
 * (@iko47)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/#post-12607782)
 * I know that I am bothered you and I am really sorry.
 * My idea is to hide events just in the homepage, in this way I can have only events
   of “today”.
 * So in this way I need to hide even the title. How can I do with the first option?
 * Tell me if it is possible. If it is too complicated, don’t worry. I have really
   appreciated your help
 * Thanks
    -  This reply was modified 6 years, 2 months ago by [iko47](https://wordpress.org/support/users/iko47/).
 *  [Roch](https://wordpress.org/support/users/rochesterj/)
 * (@rochesterj)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/#post-12608858)
 * Hi!
 * Don’t worry, let’s go for it.
 * How are you adding this title right now? Are you using the block editor or the
   classic editor?
 * We can add a class there so it is removed with a bit of JS code as well.
 * Thanks!
 *  Thread Starter [iko47](https://wordpress.org/support/users/iko47/)
 * (@iko47)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/#post-12612016)
 * Hi Roch,
 * many thanks.
 * I am using classic editor
 *  Thread Starter [iko47](https://wordpress.org/support/users/iko47/)
 * (@iko47)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/#post-12612075)
 * Maybe should it be useful a datepicker?
 *  [Roch](https://wordpress.org/support/users/rochesterj/)
 * (@rochesterj)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/#post-12614936)
 * Hi there!
 * Thanks for reaching out.
 * I’ve noticed that you changed your homepage. Do you want to keep this current
   style?
 * That’s a good solution indeed, as it will show future events.
 * Thanks!
 *  Thread Starter [iko47](https://wordpress.org/support/users/iko47/)
 * (@iko47)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/#post-12617399)
 * Hi Roch,
 * yes it was a test. Maybe you’re right, this could be a good solution. The only
   issue that i need to solve is how to match the calendar with Sportspress.
 * Anyway, thank you so much!
 * Federico
 *  [Roch](https://wordpress.org/support/users/rochesterj/)
 * (@rochesterj)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/#post-12619708)
 * Hi Federico!
 * I can see now that you have an event in your homepage.
 * And when I click it, it opens a blank page. Do you want to redirect that to a
   SP event?
 * Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Hide the empty event list’ is closed to new replies.

 * ![](https://ps.w.org/sportspress/assets/icon-256x256.png?rev=1252005)
 * [SportsPress - Sports Club & League Manager](https://wordpress.org/plugins/sportspress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sportspress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sportspress/)
 * [Active Topics](https://wordpress.org/support/plugin/sportspress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sportspress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sportspress/reviews/)

## Tags

 * [empty](https://wordpress.org/support/topic-tag/empty/)
 * [events](https://wordpress.org/support/topic-tag/events/)
 * [hide](https://wordpress.org/support/topic-tag/hide/)

 * 11 replies
 * 2 participants
 * Last reply from: [Roch](https://wordpress.org/support/users/rochesterj/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/hide-the-empty-event-list/#post-12619708)
 * Status: resolved