Posted: November 7, 2018 at 5:53 pm
|
Hello! We are using the Event Espresso Table Template to display our events. Is it possible to change the columns of the template to display different information? We would like to change the Venue column to Teacher instead. We have the teacher’s assigned through the People add-on for each class, and the venue isn’t as important. Thanks! |
Hi Jessica, It is possible, but you’ll need to be comfortable with PHP to pull in the details you need. Are you using a custom theme on your site? If not you’ll need to set up a child theme so that you can load a custom version of the table view template from that and it wont be lost when you update the theme. Take a look here: https://premium.wpmudev.org/blog/how-to-create-wordpress-child-theme/ So before going further, is that something you are comfortable with? |
|
|
Hi Tony, Thanks for getting back to me so quickly. I do know a little bit of PHP so hopefully I can figure this out. We also already have a child theme setup. Would you be able to give me some instructions on loading the custom version of the table view template and how to pull the instructors into a column instead of the venue? Thanks! |
Great!
With your child theme thats easy, grab the template from the add-on and place it in the root directory of the child theme. So The default template is Copy that and place it in your child theme You’re now loading a custom version of the template.
It really depends on how you want to display it, but as an example. Line 46-48 will be:
To repurpose the venue column to instructor, change all of that to just:
The venue column now has an ‘Instructors’ heading. Assuming ‘Instructors’ is a ‘People type’, go to Event Espresso -> People Admin -> Types Find your instructor type and note the ID number, you’ll need it below. Within the template file is a loop, anywhere in the loop add this:
You can loop over the array and either echo out the Person details, or make another array with the details, implode it and echo that. For example:
Then change lines 114-116, from:
To:
Note the above is untested but should be enough for you to work on ๐ |
|
|
Hey Tony, Thank you so much! That worked perfectly! ๐ One more question for you… For some reason, the table view will only show 10 events and the pagination won’t work. I have tried adjusting the parameters in the shortcode ([ESPRESSO_EVENTS_TABLE_TEMPLATE category_slug=art category_filter=false table_pages=30]) but it still only shows 10 on only 1 page. Here is a link to the ==> Art page. There should be roughly 27 art classes but only 10 show up and no pagination. Please help! |
That should show all of the events on the table for your. The footable paging is basically paging on the current event limit, the limit is the query limit. We are working on adding some better paging to the table template. |
|
|
Ok I gotcha. I just updated to [ESPRESSO_EVENTS_TABLE_TEMPLATE category_slug=art category_filter=false limit=30] and it still just shows the 10… any other ideas? |
|
Thanks again for your help with the table view. I will just post this new issue in a separate ticket. Cheers! |
You’re most welcome, I’ll close this thread out so we can troubleshoot in the other here: |
|
The support post ‘Changing Columns in the Table Template’ 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.