WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Featured Content Gallery] How to get slider only on homepage (2 posts)

  1. aelysium
    Member
    Posted 2 years ago #

    Hi all, I appreciate any help you could give me :)

    I decided on the Featured Content Gallery slider (but they all implement the same way) and it says to paste this line into your editor.

    <?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?>

    I have done so however, I wanted to put in a slider as it doesn't come with one but it ends up putting the slider on the homepage as well as any other page. So, also in the contact me and about pages etc which I obviously don't want.

    I'm no good with programming or code so if anyone could tell me a way to edit the code so it only appears in my homepage, I'd appreciate it. The code only seems to work in my Main Index PHP just in case anyone is wondering so I assume its in the right place but my theme isn't handling it the way I would like.

    Any suggestions? Thanks again! :)

  2. aelysium
    Member
    Posted 2 years ago #

    Wait nevermind, I sorted it myself. Need to use this code:

    <?php
    if (is_home())
    {
    include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php');
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic