How To Display Smooth Slider On The Home Page Only

Print This Post

Most of the themes use the index.php file for the homepage of the blog. If you put the Smooth slider template tag to the index.php code, you would get the slider on each of the pages using the index.php file like the category pages, tag pages, about and contact pages and so on, depending on your theme. This is because as index.php lies to the root of the Wordpress template hierarchy.

So while adding the template tag to index.php, be sure about the pages on which you want the Smooth Slider slideshow. If you want it on only the home page follow the below guidelines:-

Template tag to add Smooth Slider to the blog page:

if ( function_exists( 'get_smooth_slider' ) ) {
     get_smooth_slider(); }

Adding one more condition for the template tag would result in the Smooth Slider to appear on only Home page and the subsequent Paged pages showing the older entries on the blog:-

if ( function_exists( 'get_smooth_slider' ) and is_home() ) {
 get_smooth_slider(); }

And if you do not wish to let the smooth slider on the paged pages showing the older entries on subsequent pages, modify the call as follows:-

if ( function_exists( 'get_smooth_slider' ) and is_home()
and !is_paged() ) {
 get_smooth_slider(); }

Thus, you can insert the above template tag to your index.php so that you can show the slider on only the home page of your wordpress blog.

Google Buzz
RSS for Internet Techies Hello there! If you are new here, you might want to subscribe to the RSS feed for updates.
Share it
5 Responses to “How To Display Smooth Slider On The Home Page Only”
  1. alaJoAnn says:

    I just created a static “Home” page for alabuzz.org. (It uses the PrimePress theme, which has a special homepage template for static home pages.) The SmoothSlider was already on what is now the “Blog” page. When I try to remove it from the Blog page (which is still the index.php) and put the code in the Home page, two things happen:

    1) SmoothSlider does not appear on the new “Home” page.
    2) The Blog page disappears.

    I’ve tried disabling SmoothSlider. And I’ve tried removing the code from the blog page only. On the other side, I’ve tried inserting the code in every possible place in the homepage.php, and nothing!

    There must be more than what meets my code-challenged eye. Do I need to reinstall? And if so, where do I place the code in the homepage.php. It’s short so I’ll paste it below.

    Thank you for your help!

    <div class="entry" id="post-”>

    <?php wp_link_pages('before=‘ . __(‘Pages:’) . ‘&after=’); ?>

  2. fawz says:

    hi,

    don’t know where to start. this smooth slider suppose appear on my mainpage ( http://oppositeimage.net/v01 ) which is a static page. but currently, it appear on my bloging section. i’m not good in handling coding but perhaps you can show me how to do it.

  3. brtak says:

    Thank you very much, its working fine for me now.

  4. joey says:

    hello,

    great plug in.
    i wanted to know if the slider can be placed on a different page instead of the “home” page. for example, can i place the slider on my “about” page?

    here’s the url to my testing site.
    http://www.caresfgh.org/testingsite/

    thanks!

    joey

Leave a Reply

If you have any query or question related to Blogging, Wordpress, Monetization thru Adsense, Plugins then kindly post your queries on Internet Techies Forum. We will definitely try to resolve that or some other members from our forum will do. Thanks for the consideration.

(required)

(required)