I’m actually making a skin menu, like an input/output => show on skin option on my wordpress skin to make it easier for a user to use it. However, I’ve been trying to get the logo to show up, but keeps failing… I’ve merged CSS with PHP to make it able to take the function name; but it does not show the image in the background.
Here’s the css/php file, called bg_image.php.
<?php header("Content-type: text/css"); ?>
#logo_main{
background:url('<?php echo get_settings('ld_header_img'); ?>') no-repeat;
}
By including it to the header:
<link rel="stylesheet" type="text/css" href="./bg_image.php" />
And of course, the functions.php, which has the arrays and such for the thing to work…
$themename = "LightD";
$shortname = "ld";
$options = array (
array( "name" => $themename." Options",
"type" => "title"),
array( "name" => "Homepage",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Homepage header image",
"desc" => "Enter the link to an image used for the homepage header.",
"id" => $shortname."_header_img",
"type" => "text",
"std" => ""),
array( "type" => "close"),
array( "name" => "Footer",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Footer copyright text",
"desc" => "Enter text used in the right side of the footer. It can be HTML",
"id" => $shortname."_footer_text",
"type" => "text",
"std" => ""),
array( "type" => "close")
);
NOTICE That the full functions.php source/sample can be found in the following link below; I looked upon this topic to get this info working:
http://net.tutsplus.com/tutorials/wordpress/how-to-create-a-better-wordpress-options-panel/
Where:
name: The name of the input field.
desc: A short description explaining what it is to the user.
id: the id of the field, prefixed by the shortname. It will be used to store as well as access the options.
type: the input type – select, text or textarea
options: used to declare an array of options for a select type input.
std: the default input value, used if no other input is given.
Here’s where my question comes to place… I’ve tried using "style" inside the , and it worked:
<div id="logo_main" style="background:url('<?php echo get_settings('ld_header_img'); ?>') no-repeat;">
<div id="branding">
<div id="blog-title"><?php if ( is_singular() ) {} else {echo '<h1>';} ?><a href="<?php echo /*home_url()*/"./home/" ?>/" title="<?php bloginfo( 'name' ) ?>" rel="home"><?php bloginfo( 'name' ) ?></a><?php if ( is_singular() ) {} else {echo '</h1>';} ?></div>
<p id="blog-description"><?php bloginfo( 'description' ) ?></p>
</div>
</div>
My question is; why doesn’t the CSSed PHP doesn’t work?!
Your file doesn’t know about used function. You need to add
includestatement.