Release button after a certain date

0
<?php
  date_default_timezone_set('America/Sao_Paulo');
  $date = date('Y-m-d');

  if ($date >= '<?php the_sub_field("data"); ?>') { ?>

  <!-- Se a data for maior -->
  <a href="<?php the_sub_field('link_da_lista'); ?>">
  <button class="btn btn-success"><?php the_sub_field("nome_da_lista"); ?></button>
  </a>

 <?php } else { ?>
<!-- Se a data for menor -->
  <button class="btn btn-disabled" disabled><?php the_sub_field("nome_da_lista"); ?></button>
  <?php  } 
?>

I'm developing a portal for students, and I need to create a button that is released after a certain date that the administrator puts it. I am using WordPress and a plugin called ACF - Advanced Custom Fields

Code:

<?php if(get_field('lista_de_exame')): ?>
  <?php while(has_sub_field('lista_de_exame')): ?>
          <?php
              date_default_timezone_set('America/Sao_Paulo');
              $date = date('Y-m-d');

              if ($date >= '<?php the_sub_field("data); ?>') { ?>

              <!-- Se a data for maior -->
              <a href="<?php the_sub_field('link_da_lista'); ?>">
              <button class="btn btn-success"><?php the_sub_field("nome_da_lista"); ?></button>
              </a>

             <?php } else { ?>
            <!-- Se a data for menor -->
              <button class="btn btn-disabled" disabled><?php the_sub_field("nome_da_lista"); ?></button>
              <?php  } 
          ?>

However, when I put the date through the WordPress panel, I do not have a script response.

    
asked by anonymous 16.03.2018 / 19:52

0 answers