Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
css中的Wordpress/OptionTree引用_Css_Wordpress_Tree_Option - Fatal编程技术网

css中的Wordpress/OptionTree引用

css中的Wordpress/OptionTree引用,css,wordpress,tree,option,Css,Wordpress,Tree,Option,我使用此插件在wordpress后端以用户友好的方式动态更改css: 我设置了它,并将它附加到主题中(不再是插件)-这很有效 我不明白的是这些输入实际上被改变了。因此,我设置了一个输入字段,用户可以在其中添加一个十六进制代码(colorpicker)来更改背景,甚至字体颜色 如何在css中更改这些信息?我试过: body { {{custom_background_css}} background-color: {{custom_background_css|background-co

我使用此插件在wordpress后端以用户友好的方式动态更改css:

我设置了它,并将它附加到主题中(不再是插件)-这很有效

我不明白的是这些输入实际上被改变了。因此,我设置了一个输入字段,用户可以在其中添加一个十六进制代码(colorpicker)来更改背景,甚至字体颜色

如何在css中更改这些信息?我试过:

body {
  {{custom_background_css}}
  background-color: {{custom_background_css|background-color}};
}

其中custom_background_css为该输入字段的id。但一切都没有改变。我也阅读了文档,但我不明白…

要调整CSS的主题选项,您必须在标题中包含CSS,或者编写一个.php文件来生成所需的CSS,并链接到该文件。但也许最简单的方法是从functions.php中钩住wp_head,并直接在那里编写代码。有关要添加到functions.php的示意图示例,请参见下文

// this is the hooked function
function add_css() {

    echo "dynamically generated CSS here";
}

// Add your wp_head hooks
add_action('wp_head', 'add_css', 5);