現在,我將以下代碼放入header.php
。如何從functions.php將以下CSS代碼添加到我的頁面標題中?
我認爲解決方案不是很優雅。
如何將此代碼從functions.php
添加到我的標題(該代碼的外觀如何)?
wp_head();
?>
<style>
.jimgMenu ul li.landscapes a {
background: url(<?php bloginfo('template_directory'); ?>/images/<?php echo get_option(THEME_PREFIX . 'intro_image'); ?>) repeat scroll 0%;
}
.jimgMenu ul li.people a {
background: url(<?php bloginfo('template_directory'); ?>/images/<?php echo get_option(THEME_PREFIX . 'slider_image'); ?>) repeat scroll 0%;
}
.jimgMenu ul li.nature a {
background: url(<?php bloginfo('template_directory'); ?>/images/nature.jpg) repeat scroll 0%;
}
.jimgMenu ul li.abstract a {
background: url(<?php bloginfo('template_directory'); ?>/images/abstract.jpg) repeat scroll 0%;
}
.jimgMenu ul li.urban a {
background: url(<?php bloginfo('template_directory'); ?>/images/urban.jpg) repeat scroll 0%;
}
.jimgMenu ul li.people2 a {
background: url(<?php bloginfo('template_directory'); ?>/images/people.jpg) repeat scroll 0%;
min-width:310px;
}
</style>
要「調用」某些東西,它必須放在一個函數中,或者在它自己的文件中,你可以用include()或require()。 – 2011-02-10 20:25:26