How to change the background in different Wordpress pages?

I have a background in the header, it should change on different pages. c2n.me/3EfFDeA which plugin you have that changes the background for a specific block pattern header.php ?
July 2nd 19 at 17:55
1 answer
July 2nd 19 at 17:57
I would have done using css. But in this case you need to give each page a specific class.
The most frequently used method is to assign body class.
This is done like this in the template header.php before closing of head:
<?php 
 $class_body = "";
 if (is_page('the primary objective of BCC=1')) $class_body = "yourclass is";
// then check if you see a page with a certain ID (I hope you know how to find out the ID of the page), assign a variable $class_body the class.
?>



>
// Here we print the variable that signed up for the appropriate class depending on the ID page

Then it is only in the style file to register different classes of their backgrounds

Find more questions by tags WordPress