【问题标题】:changing background on wordpress posts page更改 wordpress 帖子页面上的背景
【发布时间】:2018-03-17 06:03:04
【问题描述】:
我正在尝试更改 just 我的 wordpress 网站上的帖子页面的背景 - http://adamcwdev.marcuscramer.co.uk/journal/
到目前为止,我已经设法使用以下代码更改了所有页面的背景:
background-image: url("http://adamcwdev.marcuscramer.co.uk/wp-content/uploads/2017/09/G91B40882.jpg");
min-height: 500px;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-color: #ffffff;
但是我不能单独更改特定的帖子页面。页面id是post=10
【问题讨论】:
标签:
html
css
wordpress
wordpress-theming
themes
【解决方案1】:
正如 Huelfe 上面或下面所述,您可以使用以下方法定位博客页面:
body.blog
您还可以使用以下方法定位单个帖子或类别页面:
body.single-post
body.category
分别。
【解决方案2】:
您将blog 定义为您身体的一个类别。使用它:
body.blog #YOURELEMENT {
background-image: url("http://adamcwdev.marcuscramer.co.uk/wp-content/uploads/2017/09/G91B40882.jpg");
min-height: 500px;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-color: #ffffff;
}