If statement to call custom stylesheet

I am looking for a way to use an If statement to call a certain custom style
something like

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

Any ideas?

Related posts

Leave a Reply

1 comment

  1. This should work for you:

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