#investment-focus-hero .jumbotron {
background: /* top, transparent red, faked with gradient */ linear-gradient( rgba(255 , 255, 255, 0.05), rgba(0, 0, 0, 0.85)), /* bottom, image */ url('<?php echo do_shortcode('[acf field="jumbotron_full_image" post_id="237"]'); ?>');
background-size: 100% 100%;
background-repeat: no-repeat;
padding-top: 37.42%;
}
最佳答案
将文件的扩展名更改为 php,然后更新您在 header 中加载 CSS 文件的链接标记的文件路径。
所以你的链接标签会从这个开始:
<link href="css/styles.css" rel="stylesheet" type="text/css" />
对此:
<link href="css/styles.php" rel="stylesheet" type="text/css" />
这样 CSS 就可以由服务器运行了!
关于php - 需要帮助将 WordPress 短代码添加到我的 css 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51365671/