Support

Home Forums Event Espresso Premium Category shows attached event even though empty

Category shows attached event even though empty

Posted: January 9, 2018 at 3:19 am

Viewing 1 reply thread


Sjoukje Oostindie

January 9, 2018 at 3:19 am

Using the Events Table View Template, empty categories are showing up even though I used the following code in the template (notice ‘hide_empty’=>true):

$taxonomy = array('espresso_event_categories');
$args = array('orderby'=>'name','hide_empty'=>true);
$ee_terms = get_terms($taxonomy, $args);

After a bit of research I can see that in the Event Espresso – Events -> Categories tab that there are events attached to categories even though they are not used in any event. In other words, it should show 0 events attached to the category. If you click on the number of attached events in a particular category that I know has no events attached the link shows an empty result. The problem is that in the Events Table View Template it is outputting these “non-empty” categories which is not desirable. Is there a reason that categories are showing attached events when this is not the case?

Cheers,
Jason


Tony

  • Support Staff

January 9, 2018 at 6:13 am

Hi Jason,

Have you ever removed events directly from the database?

The counts for the categories are from the wp_term_taxonomy table and the values are incremented/decremented as your add/remove events to and from the EE categories, they do not count the current posts assigned to that category (although they should already just hold that value).

Viewing 1 reply thread

The support post ‘Category shows attached event even though empty’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso