Custom CSS per page in Wordpress

后端 未结 4 1394
隐瞒了意图╮
隐瞒了意图╮ 2021-01-21 03:35

Good Morning All,

I have created a different background and a few other images for certain pages within our site. Currently the below code is working well with the \"kid

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-21 04:13

    Another option is simply replacing

    
    

    with

    >
    

    Then you can target it it via css as follows:

    body.page-id-2, body.parent-pageid-2 { background-color: red; }
    

    Where the ID is the ID of the page/parent-page you are targeting. This will keep your template clear of logic, and allow you the same customization options your current method is using.

提交回复
热议问题