is_front_page not working in functions.php

Question

I am trying to include a CSS file using wp_enqueue_style conditionally on whether I am on the front page. I am testing for the home page with this code:

if ( is_front_page() ) wp_enqueue_style ('TBDhome', get_template_directory_uri() . '/css/TBDhome.css','all');

It worked find when I was testing in the header file and including the CSS file.

0
LindaH53 2 years 2020-10-23T12:10:29-05:00 0 Answers 16 views 0

Leave an answer

Browse
Browse