title: detecting if it's the home page in functions.php
body: <p>I'm trying to detect if the current page is the home page in my fresh install of WordPress.</p>
  
  <p>The snippet of code below works in page.php but it does not work in functions.php. How can i detect for the homepage in functions.php in WordPress?</p>
  
  <pre><code>if (is_front_page()) {
      echo 'test';
  }
  </code></pre>
  
  <p>I know I can use <code>$_SERVER['REQUEST_URI']</code>, but I figured there should be a better way of doing this.</p>
  
  <p>In the wordpress Settings > Reading, I have a static page for my home page. is_home() does not work in my page.php but is_front_page() does work in my page.php. Both these functions do not work in my functions.php </p>