WordPress CSS 转换器?
我有一个浅色的 WordPress 主题。我通过制作新版本的 css 制作了该主题的深色版本。
我希望访问者能够从浅色版本更改为深色版本,本质上只是更改他们正在使用的 CSS 文件。
这可以吗?
I have a light colored wordpress theme. I have made a Dark version of this theme by making a new version of the css.
I want visitors to be able to change from the light to the dark version, essentially just changing which CSS file they are using.
Is this possible to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,这是可能的。
您必须检查他们选择的选项(浅色或深色)并相应地包含样式文件。
Yes, this is possible.
You have to check what option(light or dark) they selected and include style file accordingly.
查看以下链接以开始使用 Wordpress 中的主题选项页面。您将能够让某人选择“灰色”主题、“浅色”主题或您设置的任何主题。管理员中设置的任何内容都将是加载的样式表。
您想查看本教程的“配色方案”部分:
Have a look at the following links to get started with a theme options page in Wordpress. You'll be able to let someone select a "grey" theme, or a "light" theme, or whatever you set. Whatever is set in the admin will then be the loaded stylesheet.
You want to look at the "color scheme" part of this tutorial:
http://net.tutsplus.com/tutorials/wordpress/how-to-create-a-better-wordpress-options-panel/