Posted: July 11, 2018 at 11:38 am
We are seeing this error message on any page where we are showing the table layout: Warning: array_shift() expects parameter 1 to be array, string given in /home/sites/3b/6/680238a742/public_html/wp-content/themes/goodlife/espresso-events-table-template.php on line 97 Any ideas? Thanks. |
|
Hi there, Can you post the contents of |
|
Here’s the URL: https://www.thegoodlifecentre.co.uk/workshops/ |
|
Here’s the gist: https://gist.github.com/mpurse/a49a1f50fa01a82877f435582bc09a61 |
|
That template looks different from the output on your page, for example the table on the page has a Price column (which I think it’s the problem) but the code you provided doesn’t pull the price into the table. Can you double check that is the correct code, from the template in your theme. It looks like it’s the default template. |
|
Can you double check and make sure you posted the correct template? The reason I ask is because the page on your site shows 10 columns in the table, but the code you posted only has 4 columns in the table. Also, line 97 of the template you posted here does not call array_shift(). |
|
Sorry, developer on vacation and I am out of my depth. I think I have updated it. |
|
You did, thanks. So the problem is in the customized part of the template starting on line 94 where the developer added:
The espresso_event_tickets_available() function returns a string, not an array. So that explains why you’re seeing a warning that says “Warning: array_shift() expects parameter 1 to be array, string given”. The way forward will be change the custom code to use a helper method like
|
|
Excellent, thanks so much! |
|
Just to note you have what I assume is the same problem within:
When viewing the single event page and the tickets are sold out: https://www.thegoodlifecentre.co.uk/events/willow-basket-making-15/ |
|
The support post ‘Error message showing on table page’ 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.