WordPress.org

Ready to get started?Download WordPress

Forums

[closed] how to add a slider feature on homepage only (4 posts)

  1. rainbow17
    Member
    Posted 2 years ago #

    Hello...

    i would like to add a slider function to homepage only,
    while in the rest of pages will be a regular image.

    anybody? help?

    thanx,
    Daniel

  2. vtxyzzy
    Member
    Posted 2 years ago #

    Take a look at this site: http://allgoodpizza.com/

    I use the Meteor Slides plugin. I made a child theme and copied the parent header.php and added code to it to check for front page and add the slider:

    <?php if (is_front_page()
          && function_exists('meteor_slideshow')) {
       meteor_slideshow();
    } else {
       include(STYLESHEETPATH."/agp-header.php");
    } ?>

    The exact place to insert this code depends on your theme.

    The agp-header.php file checks for a post or page with a large image to use as the header:

    <?php
    // Check if this is a post or page, if it has a thumbnail, and if it's a big one
    if ( is_singular() && has_post_thumbnail( $post->ID )
          && ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) )
          && image[1] >= HEADER_IMAGE_WIDTH ) :
       // Houston, we have a new header image!
       echo "<div class='agp-custom-header'>";
       echo get_the_post_thumbnail( $post->ID, array(1000,252) );
       echo "</div>";
    else :
       // Code here for default header image
    endif;
    ?>
  3. vibhors390@gmail.com
    Member
    Posted 1 year ago #

    hi I am new user to wordpress
    I know very basic things
    I am currently using sterling theme
    in which I have created the static page as my home page
    now, I want to add the LayerSlider to the home page ie. it becomes
    part of widget I want to add it to my page
    how should I do it???

    help me??
    thnx

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Please create a new thread if you want to discuss your own issues.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags