独立于主题修改 WordPress 站点
我在网站中使用 WordPress 主题。我想编辑页面底部,替换 WordPress 默认消息并将其替换为自定义消息。问题是,我想要做出的改变应该独立于主题。我可以使用管理面板更改编辑 footer.php 。问题是,我不希望在更改主题后立即恢复更改。谁能建议如何实现这一目标?此外,我也想删除 WordPress 徽标。
I am using a WordPress theme in a site. I want to edit the bottom of the page, replacing the WordPress default message and replace it with a custom message. The problem is, the change I want to make should be independent of the theme. I can change that editing footer.php using admin panel. Problem is, I do not want the changes to be reverted as soon as I change the theme. Can anyone suggest how to achieve that? Besides I want to remove the WordPress logo, too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
恐怕这不是 WordPress 的工作方式。
与数据库相关的任何内容(帖子、页面等)都将保留在主题之间,但是您直接对主题文件所做的任何更改(编辑默认页脚文本)不仅与该主题相关,还与那些特定文件相关。如果您更改主题或将主题更新到新版本,您的更改将会丢失。
您正在编辑一个文件,当您切换主题时,该文件将不再使用。
This isn't the way wordpress works I am afraid.
Anything that is tied to the database (posts, pages etc etc) will remain from theme to theme, but any changes you make to the theme files directly (editing default footer text) are tied to not just that theme, but those specific files. If you change the theme, or update the theme to a new version, your changes will be lost.
You are editing a file, and that file will no longer be in use when you switch theme.
您可以使用插件在页面底部创建覆盖层,但这将是一个相当令人讨厌的解决方案,并且当您更改主题时可能会出现不同的情况。
或者,可以使用插件注入一些修改页脚的 javascript,但同样,这取决于您想要修改的类/ID 的主题。
基本上这不是完成的事情!
You could use a plugin to create an overlay layer at the bottom of the page but this would be a fairly nasty solution and would be liable to appear differently when you change the theme.
Alternately, a plugin could be used to inject some javascript that modifies the footer but again, would depend on the theme as to what classes/IDs you'd be wanting to modify.
Basically this isn't something that's done!