对不同 wordpress 页面设置不同背景图的方法

文章目录

    例如,如果 page 页面的 id 是 168 (从编辑页的 url 可以获知 page id)。

    那么,设置方法就是

    1. 在资源管理中将背景图上传,以获取其链接。
    2. 在 wordpress 管理后台的额外 CSS 里添加如下代码。
      body.page-id-168 { background-image: url(https://www.sunzhongwei.com/wordpress/wp-content/uploads/2018/05/bleg.jpg); background-position: center center; background-size: cover; }