admin管理员组文章数量:1431413
I'm currently working on my very first Wordpress plugin, and it is coming along nicely. I do have one question about the formatting of the generated output.
At the moment, the plugin outputs a table with the standings of several teams of a sports-club. So for every team it shows the opponents, their ranking, games played, games won and number of points scored in the games (in Dutch "doelsaldo", but I don't know how to translate that properly...).
I have not added any type of styling to the table or it's cells, figuring that the installed theme should take care of this as much as possible. I am doing the development on a localhost-installation, using the default theme, and it is nice-looking. However, when I installed it to a test-site using a different theme, it is obvious that it lacks a lot of styling.
I'm guessing I'm not the first one that runs into this problem, so I was wondering what is the advised approach for this? Should I abandon the table-tag altogether (though in my opinion, this kind of data is exactly what should be put in a table), or is it advisable to arrange everything with inline-css? Maybe I'm missing another option altogether. I'm just interested in the preferred approach for this since there are literally thousands (if not millions) of different themes out there...
I'm currently working on my very first Wordpress plugin, and it is coming along nicely. I do have one question about the formatting of the generated output.
At the moment, the plugin outputs a table with the standings of several teams of a sports-club. So for every team it shows the opponents, their ranking, games played, games won and number of points scored in the games (in Dutch "doelsaldo", but I don't know how to translate that properly...).
I have not added any type of styling to the table or it's cells, figuring that the installed theme should take care of this as much as possible. I am doing the development on a localhost-installation, using the default theme, and it is nice-looking. However, when I installed it to a test-site using a different theme, it is obvious that it lacks a lot of styling.
I'm guessing I'm not the first one that runs into this problem, so I was wondering what is the advised approach for this? Should I abandon the table-tag altogether (though in my opinion, this kind of data is exactly what should be put in a table), or is it advisable to arrange everything with inline-css? Maybe I'm missing another option altogether. I'm just interested in the preferred approach for this since there are literally thousands (if not millions) of different themes out there...
Share Improve this question edited Apr 24, 2019 at 11:07 Teja Bhagavan Kollepara 1255 bronze badges asked Jun 25, 2018 at 20:32 DiscovererDiscoverer 111 bronze badge 6- off-topic about "doesaldo" ;-) en.wiktionary/wiki/doelsaldo – mmm Commented Jun 25, 2018 at 21:12
- 2 in your plugin you can add a default stylesheet and in the plugin configuration, you give the possibility to deactivate it (or active it if the stylesheet is deactivated). – mmm Commented Jun 25, 2018 at 21:14
- @mmm Do you have an example of this? Sounds interesting! – Discoverer Commented Jun 25, 2018 at 21:41
- for the plugin configuration, read this page : codex.wordpress/Settings_API – mmm Commented Jun 25, 2018 at 22:23
- @mmm Sorry, I did not mean the configuration. I already figured that out. I meant an example how to add a stylesheet for the front-end output – Discoverer Commented Jun 26, 2018 at 16:08
1 Answer
Reset to default 0Take a look at this question (and answer) - both mine, related to the formatting of the settings input area. Disable <th> $title in Plugin Options Screen?
The default is to put settings in a table, with cells for the label, input, and despcription. If you want to have another format (not tables ,perhaps some styling, etc), then take a look at my answer. (Hint: it's related to replacing do_settings()
in the form with your own field rendering.)
本文标签: tableWordPress plugin output formatting
版权声明:本文标题:table - WordPress plugin output formatting 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745558377a2663323.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论