WP 主题上的可定制背景图像
我创建了一个 WordPress 主题,并且我制作了它,以便可以轻松更改背景图像。唯一的问题是,目前我必须手动进行更改(即 FTP),并且我想为我的客户提供一个模板选项页面,其中包含“上传新背景图像”选项。
我很确定这是可能的,我只是不知道从哪里开始。
有人能指出我正确的方向吗?
I have created a wordpress theme and I made it so the background image can easily be changed. The only problem is that currently I have to make the change manually (ie FTP) and Id like to provide my client with a Template options page with an "Upload new background image" option in it.
Im pretty sure this is possible, I just dont know where to start.
Could someone point me out in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这会为你做的。只需将以下内容添加到主题的functions.php 文件中:
目前仅适用于 WordPress 3.0。当然,无论如何您都应该运行最新版本。它将在管理区域(“外观”下)添加自定义背景菜单,并将样式添加到正文标记。还处理上传、居中/平铺(x、y 或两者)图像/背景颜色。非常简单且功能强大。
This will do it for you. Just add the following to your theme's functions.php file:
This only works in WordPress 3.0 as of now. Of course, you should be running the latest version anyway. It will add a custom background menu in the admin area (under 'Appearance') and will add the styles to the body tag. Also handles uploading, centering/tiling (x, y, or both) images/background colors. Very simple and great functionality.