Home › Forums › General Issues › get_field not returning value › Reply To: get_field not returning value
Are you sure that the field is returning nothing or could stringtotime()
not be evaluating the returned value correctly?
<?php while ( have_posts() ) : the_post(); ?>;
<?php // skip expired posts
$expirationtime = get_field("expiration");
// try outputting the values
echo $expirationtime,': ',strtotime($expirationtime);
if ($expirationtime) {
$secondsbetween = strtotime($expirationtime)-time();
if ($secondsbetween <= 0) continue;
}
?>;
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.