Home Forums Support Slider

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #105676
    Prateek

    Hi Tom,

    On my web http://ispotted.net/forestry/ I have a slider inserted using WonderPlugin Carousel. I used the php code: <?php echo do_shortcode(‘[wonderplugin_carousel id=”1″]’); ?> and embedded at the very end of header.php file.
    However, it shows up on every page I go to. I just want to have that slider on the home page. How can I fix it?
    Please let me know.

    Thanks in advance, Prateek

    #105911
    Jean Paiva
    Developer

    Hey try something like this:

    <?php if ( is_home() ) { echo do_shortcode('[wonderplugin_carousel id="1"]'); } ?>

    Maybe this could help you!

    #105917
    Jean Paiva
    Developer

    if does not work, try this:

    <?php if ( is_page(PAGE_ID) ) { echo do_shortcode('[wonderplugin_carousel id="1"]'); } ?>

    If you don’t know your #PAGE_ID, go to Edit Page > on the URL localhost/wordpress/wp-admin/post.php?post=2&action=edit > 2 is the page ID.

    #105961
    Tom
    Lead Developer
    Lead Developer

    Thanks for the above, Jean!

    Another alternative is:

    <?php if ( is_front_page() ) : ?>
          <?php echo do_shortcode('[wonderplugin_carousel id="1"]'); ?>
    <?php endif; ?>
    #106063
    Prateek

    Thanks Jean and Tom for the help. It works now.
    Tom’s code worked. Jean, I was getting an error – I believe it was the page_id as you mentioned but appreciate the help.
    Prateek

    #106143
    Tom
    Lead Developer
    Lead Developer

    Glad you got it working 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.