1

我需要在每周五晚上 9 点显示 ON AIR CONTENT,然后在上午 12 点停止并恢复为 OFF AIR CONTENT。 

以下是我手动更改以使其成为可能的 2 组代码。如果我得到正确的代码,我可以自动执行此操作。

谁能帮我?

/* ON AIR CONTENT*/

    function banner_rotator() {
    if (is_home()) { ?>
    <div id="rotator"><iframe width="630" height="386" src="http://www.ustream.tv/embed/8805257?v=3&amp;wmode=direct?autoplay=true" scrolling="no" frameborder="0" style="border: 0px none transparent;"> </iframe> <?php if(function_exists('vslider')){ vslider('frontpage'); } ?></div>
    <div class="main">
                <!-- FIFTH EXAMPLE -->
                <div class="view view-fifth">
                    <img src="../1.jpg" />
                    <div class="mask">
                        <h2>FULLY LOADED 2012</h2>
                        <p>This event has been cancelled.</p>
                        <a href="#" class="info">Details</a>
                    </div>
                </div>
                <div class="view view-fifth">
                    <img src="../2.jpg" />
                    <div class="mask">
                        <h2>KAFINAL - FALLING IN LOVE</h2>
                        <p>"The feedback to Falling in Love has been tremendous all over. I am getting calls from people in Jamaica, the Caribbean and even in the States...</p>
                        <a href="#" class="info">Read More</a>
                    </div>
                </div>  
 </div>
<?php }
}

    add_action('thesis_hook_before_content', 'banner_rotator');

    _____________________________________________________________________________________

    /* OFF AIR CONTENT */


    function banner_rotator() {
    if (is_home()) { ?>
    <div id="rotator"> <?php if(function_exists('vslider')){ vslider('frontpage'); } ?></div>
    <div class="main">
                <!-- FIFTH EXAMPLE -->
                <div class="view view-fifth">
                    <img src="../1.jpg" alt="FULLY LOADED 2012" title="FULLY LOADED 2012" />
                    <div class="mask">
                        <h2>FULLY LOADED 2012</h2>
                        <p>This event has been cancelled.</p>
                        <a href="#" class="info">Details</a>
                    </div>
                </div>
                <div class="view view-fifth">
                    <img src="../2.jpg" alt="KAFINAL - FALLING IN LOVE" title="FULLY LOADED 2012" />
                    <div class="mask">
                        <h2>KAFINAL - FALLING IN LOVE</h2>
                        <p>"The feedback to Falling in Love has been tremendous all over. I am getting calls from people in Jamaica, the Caribbean and even in the States...</p>
                        <a href="#" class="info">Read More</a>
                    </div>
                </div>  
 </div>
<?php }
}

    add_action('thesis_hook_before_content', 'banner_rotator');
4

1 回答 1

0

PHP date("G") 函数将以字符串形式提供 24 小时格式的时间。然后,您可以对其进行测试并做出您想要的任何决定。

于 2012-10-28T21:55:12.817 回答