php - 在 ACF DateTimePicker 字段的 48 小时之前显示 DIV,并在相同 ACF DateTimePicker 字段的 24 小时之后隐藏
问题描述
我试图在指定的 ACF DateTimePicker 的 48 小时之前显示一个 ACF 字段,并希望在 24 小时后隐藏它,这些字段总是显示,并且在 24 小时后没有隐藏,你能帮我解决我做错了什么吗?下面是我的代码
<?php //show match predictions only of it has a value and in between the specified date and time
$showPredictionTime = date("d/m/Y, g:i a", strtotime('+54 hours', time()));
$hidepredictionTime = date("d/m/Y, g:i a", strtotime('+78 hours', time()));
$matchStartTime = get_sub_field('match_time');
if (get_sub_field('match_predictions_url') && $showPredictionTime >= $matchStartTime && $matchStartTime <= $hidepredictionTime ) { ?>
<div class="elementor-button-wrapper">
<a href="<?php the_sub_field('match_predictions_url'); ?>" class="elementor-button-link elementor-button elementor-size-xs" role="button">
<span class="elementor-button-content-wrapper">
<span class="elementor-button-text">Predictions</span>
</span>
</a>
</div>
<?php }
?>
解决方案
推荐阅读
- android - 显示键盘时自动调整布局
- python - Pandas 列中的模式识别
- javascript - 如何在framework7中将按钮右对齐
- regex - 删除匹配行后的所有内容
- javascript - 传递异步获取的属性
- xamarin - Xamarin Forms ProgressBar 高度不可控
- angular - kendo-ui angular 6 如何在多个网格之间排列/复制宽度?
- node.js - admin.messaging().sendToDevice() 没有运行。节点.JS
- nattable - Nattable 自定义标签累加器
- html - 如何使textarea标签正确显示