Support » Plugin: WP Responsive header image slider » Header Slider only on homepage, how?

  • Resolved Schaap

    (@schaap)


    I placed in header.php the following code:

    <div class=”headerslider”> <?php echo do_shortcode(‘[sp_responsiveslider limit=”-1″ effect=”fade” autoplay_interval=”6000″]’); ?></div>

    (found it in documentation, and works fine 😀 )

    But I only want to display it on the homepage, on the wordpress header image position.

    In another thread i found this:

    <?php if(is_front_page()) {
    Shortcode will come here
    } ?>

    But … I’m not a PHP programmer, how to combine these two?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Anoop Ranawat

    (@anoopranawat)

    Hello,

    put this below code in your header file.

    <?php if(is_front_page()){ ?>
    <div class=”headerslider”>
    <?php echo do_shortcode(‘[sp_responsiveslider limit=”-1″ effect=”fade” autoplay_interval=”6000″]’); ?>
    </div>
    <?php } ?>

    Note: please write short-code parameter quotes manually. because sometimes you copied from somewhere it will take as special character and breaks the code.

    Thread Starter Schaap

    (@schaap)

    Thanks, it is working.

    Plugin Author Anoop Ranawat

    (@anoopranawat)

    Glad that it works perfect for you.

    If you like our plugin please rate us it means a lot for us.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Header Slider only on homepage, how?’ is closed to new replies.