我正在尝试为 wordpress 主题 Flexform 创建模板。我已经创建了一个页面以及该页面的特定标题。我不需要添加 body_class 调用,因为它已经存在:
<body <?php body_class($page_class . ' ' . $is_responsive . ' ' . $extra_page_class); ?>>
我检查了页面上输出的类,发现:
<body class="page page-id-5538 page-template page-template-beach-php logged-in admin-bar page-shadow responsive-fluid customize-support" style="">
我正在使用 page-template-beach-php 来设置样式,因此应用此模板的所有页面都将具有相同的样式。问题是我无法将任何内容实际应用于该页面。我尝试了以下选项,但没有显示任何内容,任何人都可以指出正确的方向吗?
尝试了选项1
.page-template-beach-php #top-bar {
background: #702c91 !important;
background-color: #702c91 !important; }
尝试了选项2
body.page-template-beach-php #top-bar {
background: #702c91 !important;
background-color: #702c91 !important; }
尝试了选项3
body .page-template-beach-php #top-bar {
background: #702c91 !important;
background-color: #702c91 !important; }
尝试了选项4
.page-template-beach-php < #top-bar {
background: #702c91 !important;
background-color: #702c91 !important; }
目前,我什至无法让它作为覆盖样式显示在 google inspect 上。
最佳答案
假设 DOM 中有一个 ID 为 top-bar
的元素,选项 1 应该可以正常工作。
能给个网址看看吗?
关于php - Wordpress Body 类未实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26124902/