【发布时间】:2010-12-19 19:31:32
【问题描述】:
我的 function.php 文件中有以下 CSS 条件语句:
function logo_exists() {
global $options;
?><style type="text/css">
#header h1 a {
<?php
if ( $options['logo'] == NULL ) { ?>
float: left;
text-indent: 0;
<?php } else { ?>
background: url(<?php echo $options['logo']; ?>) no-repeat scroll 0 0;
float: left;
text-indent: -9999px;
width: 160px;
height: 80px;
}
<?php } ?>
</style><?php
}
示例:
(...same code as above...)
width: 160px;
height: 80px;
}
<?php } ?>
</style><?php
add_option('logo_exists');
}
我不确定如何“添加”或“初始化”它。
我试过了:add_option('logo_exists');和 add_action('logo_exists');但它没有用。
function.php 文件中的条件 CSS 语句的 Wordpress“添加”命令是什么?
【问题讨论】:
-
这不是重复您的其他问题吗? :stackoverflow.com/questions/4482702/…
-
糟糕,我的意思是这个:stackoverflow.com/questions/4482295/…