Add custom background image support to wordpress

Add custom background image support to wordpress

From wordpress 3.0, added new function to control the background image. For your theme if you want to add custom background image support to wordpress theme. From wordpress 3.0 release wordpress added new function to control the background color and image. For your theme if you want to add the background functionality then you need to very simple code in your functions.php file which you find in your wordpress theme folder.

Add custom background image support to wordpress

Open functions.php file and just copy paste the code.


add_custom_background();

For enabling the background for theme you need to open header.php file and just copy paste following code in the file.

<body class="<?php body_class() ?>">

For changing the background login to wordpress admin panel and goto appearance tab and click on background tab. From here you can able to change to background image or color.

Add custom background image support to wordpress
Add custom background image support to wordpress

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

2 thoughts on “Add custom background image support to wordpress”

  1. I implemented in my theme but only works with the image option, using bg color not override my default body background.

    Any sugerence?

    I think this is not necessary:

    <body class="”>

Leave a Reply

Your email address will not be published.