Forum Replies Created

  • It is a date/time field Set to return/show in this format:

    2021-01-23 12:01:54 | Y-m-d H:i:s

    So my thinking goes, i need to first establish if an unpublished date have been set, and if it has compare it to the current time.

    This is where im at right now: still not working as intended:

       $unpublish      = get_field('unpublish');
        $current_time   = date( 'Y-m-d H:i:s' );
        if( ! empty($unpublish) ) {
            array_push( $metaQuery, array(
                'key'       => 'unpublish',
                'compare'   => '>',
                'value'     => $current_time,
  • Strange, if i format the first variable like my second example:

    $date_1 = new DateTime( '1999' );

    It will show “20 years of experience” on the frontend, if i change the variable to ( ‘1975’ ) it will show “44 years of experience” on the frontend so that part seems to work?

    My question was initially, how to insert my ACF value from the numbers field in the variable, but you are saying that even if i did, it won’t work?

  • Thank you!
    This looks like it might solve my problem!
    I’m going to try it out asap, but i have a question to fully understand what is happening here.

    These values:

    Card Value

    Is that the value set in in the Radio button field, or the field type?

    I have my radio button field set up like this:

    radio button field setup

    Just trying to wrap my head around what is what here.

    As a sidenote, I’m thinking that the group field might be the wrong field type for the result I’m trying to achieve?
    The fact that the field values is saved to the db makes for a somewhat strange user experience.
    Lets say i need to use this button field for a “banner card” where the site owner can activate the card, enter some info, add an image & activate a button, it’s a bit off that the previous values is shown?
    Is there any of the similar fields(repeater, flexible-content) that flush the db values upon deactivation, or some hook that i can link to the card activation true / false field that flush the db values upon deactivation?

  • That is basically the code i tried at first, but it throws a parse error…

    I don’t know if the way i set things up with echo’ing out each div is the best/most elegant way to go about this problem?

Viewing 4 posts - 1 through 4 (of 4 total)