Html 如何编辑WordPress页面的html代码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28338249/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to edit WordPress page's html code
提问by cmit
I can't get editable html code behind the page. I want to make some changes to the page. Web site is hosted in the remote server. Someone assigned this task. There is empty editor when open edit page as below image.
我无法在页面后面获取可编辑的 html 代码。我想对页面进行一些更改。网站托管在远程服务器中。有人分配了这个任务。打开编辑页面时有空的编辑器,如下图。
Also I added plugin and actived it but can't get the result.
我还添加了插件并激活了它,但无法获得结果。
回答by Phil Nind
The picture you posted is of the WYSIWYG editor, which is only for adding content to the page.
您贴的图片是所见即所得编辑器,仅用于向页面添加内容。
If you want to edit the layout of the page itself you have 2 options -
如果您想编辑页面本身的布局,您有 2 个选项 -
Minor page edits to appear across all pages on the site - Go to Appearance -> editor -> page.php and then edit the code to suite your needs.
小页面编辑显示在站点上的所有页面 - 转到外观 -> 编辑器 -> page.php,然后编辑代码以满足您的需求。
Large page edits to appear on one or two pages -
大页面编辑显示在一页或两页上 -
- Get access to the files
- Duplicate page.php with a different name
- Edit code
- 获取对文件的访问权限
- 具有不同名称的重复 page.php
- 编辑代码
When you go to add a new page you should have an option to pick a page template. Choose the page template you just created.
当你去添加一个新页面时,你应该可以选择一个页面模板。选择您刚刚创建的页面模板。
回答by user1032613
If you know exactly what you are doing, you can use Chrome "Inspect" feature, and change the HTML of the content inside the WordPress WYSIWYG Editor. After injecting your HTML, click Preview or Publish and your changes will be saved correctly.
如果您确切地知道自己在做什么,则可以使用 Chrome 的“检查”功能,并在 WordPress 所见即所得编辑器中更改内容的 HTML。注入 HTML 后,单击预览或发布,您的更改将被正确保存。