Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要从 2020 主题中删除标题 - 在我的子主题模板中删除它没有问题。但是它仍然显示在 WP 编辑器中。因为它在一个分隔符中,如下所示:
<div class="editor-post-title">
我尝试添加一个 CSS,例如:
.editor-post-title { display:none; }
当我在我的浏览器编辑器中本地尝试它时,这非常有效 - 但是当我在我的样式表中插入该 CSS 时它不起作用......有什么想法吗?
您的主题样式表仅加载在前端(通常)。
如果您想在编辑器中添加各种样式,请尝试这篇文章。
或者对于一个快速而肮脏的修复,你可能会做这样的事情,但从技术上讲,上述方法可能更好,而且不那么hacky:
add_action( 'admin_footer', 'remove_title' ); function remove_title() { echo ' <style> .editor-post-title { display:none; } </style> '; }