Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
325 views
in Technique[技术] by (71.8m points)

php - Show a DIV before 48hours of ACF DateTimePicker field and hide after 24hours of the same ACF DateTimePicker field

I'm trying to show an ACF field before 48hours of a specified ACF DateTimePicker and want to hide it after 24 hours, the fields are always showing, and not getting hidden after 24 hours, could you please assist me what am I doing wrong, below is my code

    <?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 }  
    ?>
question from:https://stackoverflow.com/questions/65829787/show-a-div-before-48hours-of-acf-datetimepicker-field-and-hide-after-24hours-of

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...