Simple Hooks – wp cycle on home page only

Community Forums Forums Design Tips and Tricks Simple Hooks – wp cycle on home page only

This topic is: resolved

This topic contains 6 replies, has 3 voices, and was last updated by  BerniceKidd 1 year, 8 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #23525

    BerniceKidd
    Participant
    Post count: 2

    HI. I am using the decor8ted theme and have installed the genesis simple hooks. I have added this code to install wp-cycle on the homepage.

    <?php if( function_exists(‘wp_cycle’) ) wp_cycle();?>
    &nbsp;

    It has been installed in the genesis_before_content_sidebar_wrap Hook area. WP-cycle  is now showing on all pages. How must I change the code so that I can I get the wp-cycle slider to just show up on the homepage?  I am not a developer so if someone can give me the actual code to add, I would be very grateful! :-)
    thanks.

    #23527

    echofoxtrot
    Participant
    Post count: 33

    I think you would write:

    <?php if( is_front_page() && function_exists(‘wp_cycle’) ) wp_cycle();?>

    #23530

    braddalton
    Participant
    Post count: 10587

    You could add a widget using the conditional tag for your home page and use the Genesis responsive slider.


    #23531

    echofoxtrot
    Participant
    Post count: 33

    I agree! That Genesis responsive slider is terrific.

    #23550

    BerniceKidd
    Participant
    Post count: 2

    Thanks Echofoxtrot and Brad.  I have added that code and it has worked but unfortunatley it doesn’t show on the hompage now either.  The homepage is a static page called “About Us” – perhaps that makes a difference?  (Settings>Reading>Static page>frontpage is “About Us”)

    #23556

    echofoxtrot
    Participant
    Post count: 33

    The name of the home page shouldn’t make a difference. Try it this way:

    <?php
    if (is_front_page() ) {
    if (function_exists(‘wp_cycle’) ) wp_cycle();
    }
    ?>

    And make sure that you check the “Execute PHP on this hook?” box.

    #24499

    BerniceKidd
    Participant
    Post count: 2

    Thanks, i used this code but the slider still didn’t show up on any page. After much trial and error, i found that this code worked;
    <?php {
    if( ! is_front_page() )
    return false;

    echo ‘<div id=”home-slider”>';
    wp_cycle();
    echo ‘</div>';

    }
    ?>
    &nbsp;
    Thanks for taking the time to help me figure it out; much appreciated
    !!

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Simple Hooks – wp cycle on home page only’ is closed to new replies.