客户端如何在不破坏 HTML 的情况下编辑 WordPress?
通常我通过放入所有 HTML 来在 Wordpress 中设置页面,客户端将在所见即所得编辑器中编辑内容,
这很棒,直到他们不小心删除了 div 或破坏了某些内容。
正确的方法是什么,以防止白痴的出现,以便他们可以更改标题、段落等,而不会删除部分结构?
Usually I set up pages in Wordpress by putting all the HTML in and the client will edit the content in the WYSIWYG editor
This is great, until they accidentally delete a div or break something.
What is the correct way to go about this making it idiot proof, so that they can change titles, paragraphs etc without potentially deleting parts of the structure?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您的客户不了解 HTML,并且您在项目中知道这一点,那么他/她应该在页面编辑器中输入的唯一内容是单词、上传的媒体以及可以使用可视化编辑器插入的元素。这是一个痛苦的事情,但你的主题应该是“白痴证明”的部分。
构建主题以将
the_content();
包装在 div 中,并设置可以相应输入的所有潜在元素的样式。仅依赖可使用 CKEditor 添加的元素。例如(在循环内,在主题模板文件中)
然后你的CSS:
等等。
If your client does not know HTML, and you know this going into the project, the only things he/she should be inputting in the page editor are words, uploaded media, and elements that can be inserted using the visual editor. It's a pain in the butt, but your theme should be the part that's "idiot proof".
Build your theme to wrap
the_content();
in a div, and style all the potential elements that can be input accordingly. Only rely on elements that can be added using the CKEditor.e.g. (within the loop, in a theme template file)
Then your CSS:
etc.
现在我有几个选择:
所有这 3 个都很容易实现! :)
[] 的
There's a few options that comes to me right now:
All these 3 are quite easy to implement! :)
[]'s