Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

PHP if function tied to time not working

Home / Forums / Pinnacle Theme / PHP if function tied to time not working

This topic is: Not Resolved
[Not Resolved]
Posted in: Pinnacle Theme
August 18, 2017 at 5:36 am

Hi, I wrote a simple piece of PHP code to display some text only during certain hours. It’s doesn’t break anything in the theme, but it also doesn’t render, and I’m wondering if it’s some conflict with the theme. I just want the “Available Now on Text” to appear during the hours of 7a and 7p. Appreciate the help.

<?php
$time=date(“H”);
$timezone=date(“America/New_York”);
if ($time > “7” && $time < “19”) { ?>
<span class=”onDuty”>Available Now on Text:</span> 561-220-7733 <br />
<?php } ?>

  • The forum ‘Pinnacle Theme’ is closed to new topics and replies.