In my header.php file, I only want to load the font-awesome css file if the page is not my main page (it is costing 1 sec of load time and barely does anything).
The following code in the <head>
html part, does not work:
<?php if ( !is_home() ){ ?>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<?php } ?>```
First, if you want to target the site Front Page, you need to use is_front_page(). The is_home() conditional returns true when the blog posts index is displayed, which may or may not be on the site Front Page.
Second, you need to hook your function into an appropriate hook, which it appears, in this case, is wp_enqueue_scripts.