Posted: November 18, 2014 at 2:56 pm
While using the custom templates add-on, I noticed that the category filter was not behaving correctly. Looking at the source code, I discovered that many events contained markup like the following:
However, many of the events correctly displayed the category ids:
I checked inside the admin interface and confirmed that multiple categories were indeed set (checked off) for both of the above example events. By using the following query in phpMyAdmin, however, I noticed that category_id is NULL for many events, but not for others:
*** Is it possible that category_id is a new(er) field, which is why existing/old events do not have the categories listed in that field? I recently upgraded from 3.1.24.1.P all the way to 3.1.36.6.P. Is there a query I can run to populate that field with the correct category ids? Thank you, |
|
|
Take a look at the wp_events_category_rel table and see if there are entries there which correspond to the categories assigned to one of the bad events. If the data is there, then you should be able to get it into the field in wp_events_details. |
Thank you Sidney. FYI, after quite a bit of digging, I found the following post with a function that allowed me to avoid using category_id field: |
|
For some reason the link was stripped off: https://eventespresso.com/topic/category_identifier-returns-null/ |
|
|
Thanks for posting your solution! |
The support post ‘wp_events_detail – Some events category_id is NULL when it shouldn't be’ 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.