• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Slider on home, other pages to pull featured image.

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Slider on home, other pages to pull featured image.

This topic is: resolved

Tagged: Agency, featured image, genesis, slider

  • This topic has 9 replies, 2 voices, and was last updated 12 years, 5 months ago by KarenLeighBurton.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • August 28, 2013 at 10:43 am #59239
    KarenLeighBurton
    Member

    I am working on a site http://www.readyvillemill.com

    We have an area set at the top of each page that currently displays the "genesis responsive slider". My client would like the slider itself to only appear on the homepage, but when you visit a page or post the "featured image" from that page (if none assigned then by default display the slider) in that location.

    I'm sure it's some code that just needs to go into either the functions or the home.php (or both) but I am not a very strong php coder. Can someone help me with this functionality?

    It would be much appreciated.

    Thank you 🙂

    http://www.readyvillemill.com
    August 28, 2013 at 11:38 am #59251
    Sridhar Katakam
    Participant

    Place a file named page.php having this code in agency directory: http://pastebin.com/3cVnBf3V

    That should do it.


    Genesis Tutorials | Follow me on Twitter

    August 28, 2013 at 12:05 pm #59260
    KarenLeighBurton
    Member

    Thank you - 🙂

    That works - but it is still running the slider so it now has the slider on top and the featured image below;
    http://www.readyvillemill.com/about/

    any additional suggestions?

    August 28, 2013 at 12:11 pm #59263
    Sridhar Katakam
    Participant

    That is strange, it doesn't work like that in the test site on my localhost. Hopefully someone more experienced can chime in.


    Genesis Tutorials | Follow me on Twitter

    August 28, 2013 at 12:13 pm #59265
    KarenLeighBurton
    Member

    nevermind! I think I may have figured it out and fixed it - woohoo!
    Thank you very much.

    August 28, 2013 at 12:23 pm #59272
    Sridhar Katakam
    Participant

    Can you share the solution for everyone's benefit?


    Genesis Tutorials | Follow me on Twitter

    August 28, 2013 at 12:46 pm #59277
    KarenLeighBurton
    Member

    well I created a special widget area called welcome-text in the theme which was assigned to "all pages/posts/home" etc. I figured out I needed to acutally use the home-slider widget section for the slideshow - once i moved the slideshow there it worked. I did have to apply a div to the featured image so that it just wasn't left aligned on the top of the page.

    I made this edit to the page.php code;
    <?php

    add_action( 'genesis_after_header', 'agency_home_welcome_helper' );

    function agency_home_welcome_helper() {

    echo '<div id="home-welcome">';
    if (has_post_thumbnail( $post->ID ) ) :
    echo get_the_post_thumbnail($post->ID);
    echo '</div><!-- end #home-welcome -->';

    else :

    if ( is_active_sidebar( 'home-slider' ) ) :
    echo '<div id="home-slider">';
    dynamic_sidebar( 'home-slider' );
    echo '</div><!-- end #home-slider -->';

    endif;

    endif;

    }

    genesis();

    October 1, 2013 at 7:57 pm #65031
    KarenLeighBurton
    Member

    Sridhar, Wondering if you know how to do this same thing on an un-modified version of eleven40 (not the pro). I want to use the page-title widget area to display a slider or image on the homepage, but then on all pages/posts pull the featured image - if none revert to the homepage image. I've asked, I've even tried what you provided above and it's not working...

    its a development site so no url to publish - Child - Eleven40 vs 1.1 Genesis - vs 2.0.1

    I've made no other modifications to this theme at all yet - figured I'd start with this first... Would greatly appreciate if you can help.

    I put this in a page.php template in the theme folder;

    <?php

    add_action( 'genesis_before_content_sidebar_wrap', 'eleven40_page_title' );

    function eleven40_page_title() {

    if (has_post_thumbnail( $post->ID ) ) :
    echo get_the_post_thumbnail($post->ID);

    else :

    if ( is_active_sidebar( 'page-title' ) ) :
    echo '<div id="page-title">';
    dynamic_sidebar( 'page-title' );
    echo '</div><!-- end #page-title -->';

    endif;

    endif;

    }

    genesis();

    October 5, 2013 at 1:23 am #65435
    Sridhar Katakam
    Participant

    Here you go: http://sridharkatakam.com/show-featured-image-present-otherwise-show-responsive-slider-genesis/


    Genesis Tutorials | Follow me on Twitter

    October 5, 2013 at 10:27 am #65475
    KarenLeighBurton
    Member

    OM Gosh - this is awesome! Thank you so very very much!

  • Author
    Posts
Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Slider on home, other pages to pull featured image.’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble