最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom field - Expire Date Condition not Working ACF WordPress

programmeradmin3浏览0评论

I am trying to Add the Condition if Expire date is smaller than the current date expired in the post. But the condition not working please check the code below.

    <?php if (!empty($apply_from)) { ?>
                    <li>
                        <?php 
                    $expire = get_field('expire_date');
                    $date = date('Ymd');
                            if($expire < $date) { 
                    ?>
                            <p>Expired</p>
    
                        <?php
                        } else { 
echo $expire_date; 
                        }   
                            ?>
                    
                    </li>
                    <?php 
                                
                            }
                            ?>
发布评论

评论列表(0)

  1. 暂无评论