WordPress.org

Support

Support » Plugins and Hacks » why is get_field not returning any values?

why is get_field not returning any values?

  • Jenksuy
    Member

    @jenksuy

    Hi There,

    So I am using ACF to add dates to event posts. And I am looking to format the date. However the get_field code seems to be not returning any values for me? However if i just print the date with ‘the_field’ code it is obvious that there are values there.

    here is my code

    <?php
            $timestamp = strtotime(get_field('event_date'));
    	print date("Y-m-d H:i:s", $timestamp);
    ?>

    Does anyone know how I can Fix this?

    Thanks
    Chris

    http://wordpress.org/plugins/advanced-custom-fields/

  • The topic ‘why is get_field not returning any values?’ is closed to new replies.