If语句调用自定义样式表


If statement to call custom stylesheet

我正在寻找一种使用If语句来调用特定自定义样式的方法类似的东西

if ( is_page('page-id') ) {
    "line to call stylesheet2.css";
    }

有什么想法吗?

这应该适用于您:

if(is_page('page-id')){
    echo '<link rel="stylesheet" type="text/css" href="my.css">';
}else {
    echo '<link rel="stylesheet" type="text/css" href="another.css">';
}