Plugin Author
Brian
(@brianmiyaji)
@boldt thanks for your feedback. It sounds like this is a popular request so I’ve added it to our GitHub project for consideration in a future update: https://github.com/ThemeBoy/SportsPress/issues/96
In the meantime, you could create your own page template inside the theme folder to override the default template.
Thread Starter
Boldt
(@enso)
I’m trying to imagine how that could work for my situation. By the time I get to a page template the event list HTML has already been generated by the event-list.php SportsPress template. I’d have to use get_the_content() and write some PHP (likely using regular expressions) to reorder the columns in the table.
But even that would only work if I were displaying a single post type on a page using a custom SportsPress page template. I actually use shortcodes to combine the standings and schedule for each bracket on its own page. I’m already using a custom post type that takes the league table and event list shortcodes as inputs to generate a page.
For now, I’m editing event-list.php to change the column order for the Home/Away option (and remove the event links), but I have to do that for every release of SportsPress, which is a pain. I just don’t see any alternative for my situation other than getting the ability to specify column order added to the plugin.
Plugin Author
Brian
(@brianmiyaji)
@boldt our documentation needs some work, but you can actually include any of the templates inside your theme to override the default. In this case, create a copy of:
wp-content/plugins/sportspress/templates/event-list.php
inside your theme folder:
wp-content/themes/MY_THEME/sportspress/event-list.php
where MY_THEME is the folder of the currently active theme.
I hope this makes sense 🙂
Thread Starter
Boldt
(@enso)
No problem. It makes perfect sense. The documentation only mentioned the page templates so I didn’t realize that I could put other types of templates in that folder. That will make updates a lot easier (as long as you don’t make any other changes to those data formatting templates, of course). Thanks for the quick response to my comments.