I have my own wordpress template with option setting. My option setting having option for background Image path. I saved this option value in variable .Now how i can add this option setting value to get background Image for specific div class?
I have my own wordpress template with option setting. My option setting having option
Share
You’ll need a page that you can put both CSS and PHP on, like header.php in your template. Be sure to note that this CSS hack is there so that you can re-add it when you update the theme.
Now, in your header.php file, just before the
</head>tag, add this:You’ll need to add a CSS selector to select the div you want to have tha background image, and you’ll need to make sure that the background image links correctly. You may need to add /wp-content/ or similar things to the CSS or the option value if the image doesn’t link correctly at first.