Posted: November 27, 2012 at 12:06 pm
|
In the event_list_display.php each event div#event_data-X is supposed to get various classes assigned via PHP variables. One of these variables is $category_identifier which I assume is supposed to return the name(s) of the category that the event belongs to. Instead, it returns NULL. It does this in the original file and in a custom file. Any ideas on how to get an event’s category/categories on this page? |
|
I just looked through the mySQL tables a little. I noticed that in the ‘jfewp_events_detail’ table there is a column called ‘category_id’. Each event that I have created has a value of NULL for this column, even though each one is assigned to at least one category. The ‘jfewp_events_category_rel’ and ‘jfewp_events_category_detail’ tables look okay though, so maybe this $category_identifier variable is just trying to pull a value from the wrong place? I guess I’ll just write my own function so this works… |
|
Well I made a function that returns category IDs for a given event. YOU’RE WELCOME 😛 Here is the function to add to custom_functions.php
And in event_list_display.php, use this for the opening div (Note this is really hard to do since the code view still seems to apply HTML entities to what I type, just imagine your own HTML and ?php brackets ):
I’m not marking this as resolved since $category_identifier is probably supposed to return something other than NULL for everything. |
|
UGH these forums are crap. Apparently I can only edit a post once and doing so mangles the code samples. So here is that function again (I hope this displays correctly):
|
|
Just remember to replace the |
Hi there, Thanks for posting this. I’ll pass this along to the dev team. From what I remember, it will add the category_identifier if there’s a category set as a parameter. It’s when there’s not a category parameter in the event_list shortcode that NULL is returned, which your fix addresses. |
|
The support post ‘$category_identifier returns NULL’ 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.