排隊動態CSS我一個入隊PHP文件讓我在travelify,子文件夾的functions.php dynamcis風格在WordPress沒有按牛逼工作
add_action('wp_enqueue_scripts', 'theme_enqueue_styles');
function theme_enqueue_styles() {
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
wp_enqueue_style('style_perso', get_stylesheet_directory_uri() . '/styleperso.php');}
該文件是正確排隊,但它不冒這個PHP代碼
這是我styleperso.php短爲例
<?php
header("Content-type: text/css; charset: UTF-8");
$newbgcolor ='red';
$newbgimage = 'none';
?>
body.custom-background {
background-color: <?php $newbgcolor ?>;
background-image: <?php $newbgimage ?>;
background-repeat: no-repeat;
background-position: top right;
background-attachment: fixed;
background-size: cover;
}
我試圖把文件中的
require '/../../../wp-load.php';
但它沒有任何區別。
感謝您的幫助
可能的答案[點擊這裏](https://css-tricks.com/ CSS-變量與 - PHP /#文章頭-ID-5)。 –