• Resolved Fi Fi P

    (@fi-fi-p)


    Is it possible to have two home pages. I would like to make two, one for during the day and one for at night.
    Is there code I can use to alternate the home page every 12hours?
    I have used code to swap images:

    <?php
    $hour = date(‘H’); // hour of the day, 24 hour clock
    if( $hour >= 06 or $hour < 18)
    $img_name = ‘picturejelly.jpg’;
    if( $hour >= 18 or $hour < 6)
    $img_name = ‘picturesmoke.jpg’;
    ?>

    Is there something like this I can use that targets my pages?
    Any help would be much appreciated

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Fi Fi P

    (@fi-fi-p)

    Is the below anywhere near?

    <?php

    $hour = date(‘H’); // hour of the day, 24 hour clock

    if( $hour >= 06 or $hour < 18)
    if ( is_front_page() {

    get_option( ‘show_on_front’ );

    }

    if( $hour >= 18 or $hour < 6)

    else {

    get_option(753);

    }
    ?>

    Thread Starter Fi Fi P

    (@fi-fi-p)

    <?php

    $hour = date(‘H’); // hour of the day, 24 hour clock

    if( $hour >= 06 or $hour < 12)

    if(is_front_page()) { ?>
    <div>
    <?php
    $id=247;
    $post = get_post($id);
    $content = apply_filters(‘the_content’, $post->post_content);
    echo $content;
    ?>
    </div>
    <?php }

    if( $hour >= 12 or $hour < 6)

    if(is_front_page()) { ?>
    <div>
    <?php
    $id=753;
    $post = get_post($id);
    $content = apply_filters(‘the_content’, $post->post_content);
    echo $content;
    ?>
    </div>
    <?php }

    Thread Starter Fi Fi P

    (@fi-fi-p)

    I thought I had it with the above code, but it is still not working

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Alternating between two Home Pages’ is closed to new replies.