add different background image to each wordpress posts

add different background image to each wordpress posts

WordPress tutorial, add different background image to each wordpress posts. You can change the background images for each wordpress post or change color.  you can change the background color also. Some times this can be doable through CSS also. But here I am going to give you very simple technique.

add different background image to each wordpress posts

Following code you just need to place in your single.php file.

 


if(is_single('17')){
// When Post 17 (ID) is being displayed.

echo "<style>
body{
background: #000 url(images/bgbody.jpg) top center no-repeat;
}</style>";
}

This way you can add the different background image to each wordperss post.

add different background image to each wordpress posts
add different background image to each wordpress posts

 

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

One thought on “add different background image to each wordpress posts”

Leave a Reply

Your email address will not be published.