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">';
}