Support

Account

Home Forums Front-end Issues Date output Reply To: Date output

  • I’m having this same issue, trying to get the date to automatically display formatted like “Mon July, 29”.

    If I use the code above, it breaks the page and nothing will load. Any thoughts on this? I love this plugin by the way!

    Here is the code that I’m using. The “onsale” field is the Date Picker and I would like to reformat how it displays on the page. Thanks!

    <?php
    $onsale_date = strtotime(get_field(‘onsale’));
    $now = time();

    if ($onsale_date > $now) {
    ?>
    On Sale

    <?php
    echo get_field( ‘onsale’ );
    }
    else { echo get_field( ‘price’ );
    }
    ?>