WordPress.org

Support

Support » Plugins and Hacks » SlideDeck 2 Lite Responsive Content Slider » Code for Implementing Only on the Home Page?

Code for Implementing Only on the Home Page?

  • Hey! I’ve successfully added the shortcode to render the slider on my site in index.php… but is there an extra snippet of code I can use to render it ONLY on my home page… and not on every other archive page?

    My code right now is…

    <?php echo do_shortcode( "[SlideDeck2 id=5913]" ); ?>

    Thanks for reading!

    http://wordpress.org/extend/plugins/slidedeck2/

Viewing 3 replies - 1 through 3 (of 3 total)
  • <?php if(is_front_page() ) { ?>
    <?php echo do_shortcode( "[SlideDeck2 id=5913]" ); ?>
    <?php } ?>

    Should do the trick…

    I’ve written a complete guide to installing Slide Deck in any location in any theme.

    Or you could use this:

    Paste this code in your header.php file

    <?php
    if (is_home()) {
    echo do_shortcode('[SlideDeck2 id=007]');
    }
    ?>

    Change the i.d (007) to your own.

    Or use this code if you’re using a static page as your home page rather than the default.

    <?php
    if (is_front_page() ) {
    echo do_shortcode('[SlideDeck2 id=007]');
    }
    ?>

    Try this if the above fails.

    <?php if( is_front_page() && !is_paged() ) : ?>
        <div id="SlideDeck2">
    <?php echo do_shortcode('[SlideDeck2 id=1673]'); ?>
        </div>
    <?php endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Code for Implementing Only on the Home Page?’ is closed to new replies.
Skip to toolbar