php - 获得最多 3 个变量的输出
问题描述
我需要帮助。我有 3 个设置,每个设置都有几个不同的值。如您所见,我有 3 个 $font_weight 设置。
$font_weight 有 3 个输出值。
$font_weight2 有 2 个输出值。
$font_weight3 有 2 个输出值。
入队的 CSS 文件命名如下,例如“open_sans400.css”。
我希望你明白我的意思。如果您不明白,请提出问题,以便我们找到解决方案
function fonts() {
$font_family = get_theme_mod('font_body', 'open_sans');
$font_weight = get_theme_mod('font_weight', 400);
$font_weight2 = get_theme_mod('font_weight2', 700);
$font_weight3 = get_theme_mod('font_weight3', 400);
if ( // if $font_weight took a value ) {
$font_weight_c = // what is value between ( 400, 700, 800 );
} elseif ( // if $font_weight2 took a value ) {
$font_weight_c = // what is value between ( 400, 500 );
} elseif ( // if $font_weight3 took a value ) {
$font_weight_c = // what is value between ( 500, 700 );
}
wp_enqueue_style( 'fonts-css', '//site.com/fonts/'. $font_family.$font_weight_c .'.css', array(), null, 'screen' );
}
解决方案
推荐阅读
- c# - 在单独的类/表单中使用引用的 C# 对象
- typo3 - TYPO3 v9.5 站点:语言重定向
- c# - 将字节数组转换为 Json 以通过 REST Api C# 将附件发布到 TFS
- python - 使用 seaborn pairplot 绘制子图
- r - 在彼此之上创建一个双 y 轴
- r - 在 R 中测试置信区间
- c# - 如何避免 BeginInvoke() 中的竞争条件?
- vba - 如何在 VBA 的 Concat 函数中放置换行符
- javascript - 如何使用 jquery 在视口中获取当前查看的 div/div(s)
- couchdb - 从nodejs中的`pouchdb`连接到`couchdb`时如何验证`couchdb`?