Theme Options – CSS div Background Image
-
What code do I need to be able to change a background image of a particular div in the Themes Option Panel.
I wanted to set it up so I would only have to type the name of the correct image I want it to put in the background.
OPTIONS.PHP$options[] = array( "name" => "Menu Background", "desc" => "silver, green, black", "id" => "menu_template", "type" => "textarea");If I were changing something in a php file I know I could just put
<?php echo of_get_option('menu_template'); ?>right where I want it to insert the text, but what it the most efficient way to target the background style so It can be switched out.Is there a good way of adding the style w/php?
.navbar { background: url(images/bar.png) top left repeat; width: 800px; height: 35px;margin: 0px auto; }What I want to do is basically
.navbar { background: url(images/<?php echo of_get_option('menu_template'); ?>.png) top left repeat; width: 800px; height: 35px;margin: 0px auto; }But I know unicorns don’t exist and I know I can’t add the php to the css like that so please help. I know this is a stupid question to most of you but I am such a newbie w/ wordpress & php
The topic ‘Theme Options – CSS div Background Image’ is closed to new replies.