title: How to add class to Wordpress's body element with time date condition?
body: <p>I'm figuring out how to add class to wordpress body element with time date condition, there an example:</p>
  
  <pre><code>jQuery(document).ready(function() {
  
  
  
  function applyclass()
  {
  var d = new Date();
  var n = d.getHours();
  
  
  
  
  
  if (n &gt; 20 &amp;&amp; n &lt; 06)
  jQuery('body').addClass('night');
  
  else if (n &gt; 16 &amp;&amp; n &lt; 19)
  jQuery('body').addClass('sunset');
  
  else
  jQuery('body').addClass('day');
  }
  window.onload = applyclass;
  
  
  });
  </code></pre>
  
  <p>I checked everything including folder locations and no console errors, but the problem is this script is not executing.</p>
  
  <p>Thanks!</p>