PHP:strotime的问题

时间:2015-03-31 17:00:58

标签: php wordpress

所以我试图在webinar_end_date之后一小时在网页上显示一些代码。我写了这段代码:

 <section id="webinar-details">
                    <?php
                    $webinar_date = types_render_field("start-date", array( "raw" => "true"));
                    $webinar_end_date = $webinar_date + ('1 hour');
                    $lp_url = types_render_field("landing-page-url", array("raw" => "true","show_name" => "false" ));
                    if($webinar_end_date < time()){
                        $btn_text = webinar_cta_link_text($lp_url);
                    }else{
                        $btn_text = 'Register Now';
                    }
                    ?>
                    <time id="webinar-start" itemprop="startDate" datetime="<?php echo date("c",$webinar_date); ?>"><?php echo date("M j, Y g:i a",$webinar_date); ?> ET</time>
                    <time class="hide" itemprop="endDate" datetime="<?php echo date("c",$webinar_end_date); ?>"><?php echo date("M j, Y g:i a",$webinar_end_date); ?> ET</time>
                    ​<meta itemprop="location" content="Online" />
                    <meta itemprop="duration" content="PT1H" />
                    <?php 
                    if(!empty($lp_url)){
                    ?>
                        <a itemprop="url" class="bob blue-bob" href="<?php echo $lp_url;?>" target="_blank"><?php echo $btn_text;?></a>
                    <?php 
                    }
                    ?>

                        <br />
                        <br />

                    <?php 
                    if(strtotime($webinar_end_date) > strtotime($webinar_date)){
                    ?>           
            <div id="spotlight-markup-1">
                <h3>Get Started</h3>
                <p>Don't know where to start? No worries. Your sales enablement journey starts here.</p>
            </div>
            </section>
                                    <?php 
                }
                ?>

            <?php 

但它在事件发生之前和之后都会回归。关于我哪里出错的任何想法?

0 个答案:

没有答案