Add Featured Pages to Already Altered Static Homepage in Streamline

Community Forums Forums General Discussion Add Featured Pages to Already Altered Static Homepage in Streamline

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  cehwitham 1 year, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #38598

    swansonwc
    Participant
    Post count: 10

    Hi,

    I have a static homepage in Streamline that I’ve already edited to display an image slider above the page content. Now, I’d like to use Home Featured areas above the slider and sidebar. The site is: http://75.103.78.29/~kellyswa/

    Here are the changes I’ve made to the functions.php earlier:

    functions.php

    `
    genesis_register_sidebar( array(
    ‘id’ => ‘home-custom’,
    ‘name’ => __( ‘Home Slider’, ‘streamline’ ),
    ‘description’ => __( ‘This is the slider widget area for your homepage.’, ‘streamline’ ),
    ) );

    add_action( ‘genesis_before_loop’, ‘child_before_content’);
    function child_before_content() {
    if ( is_page(2) ){ echo ”;
    dynamic_sidebar( ‘home-custom’ );
    echo ‘‘;
    }

    }
    `

    http://75.103.78.29/~kellyswa/">http://75.103.78.29/~kellyswa/
    #43709

    cehwitham
    Participant
    Post count: 396

    Have you added the Featured Page widget into the sidebar you created?

    Chris


    Twitter: cehwitham Web: cehwitham.com

    #43811

    swansonwc
    Participant
    Post count: 10

    Chris,

    Thank you for responding to my post.

    I added the Genesis Responsive Slider to the custom sidebar area that I created. However, I didn’t create a custom sidebar for the Featured Page Widget, because it already exists on the functions.php page:
    `genesis_register_sidebar( array(
    ‘id’ => ‘home-featured-1′,
    ‘name’ => __( ‘Home Featured #1′, ‘streamline’ ),
    ‘description’ => __( ‘This is the featured #1 column on the homepage.’, ‘streamline’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’ => ‘home-featured-2′,
    ‘name’ => __( ‘Home Featured #2′, ‘streamline’ ),
    ‘description’ => __( ‘This is the featured #2 column on the homepage.’, ‘streamline’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’ => ‘home-featured-3′,
    ‘name’ => __( ‘Home Featured #3′, ‘streamline’ ),
    ‘description’ => __( ‘This is the featured #3 column on the homepage.’, ‘streamline’ ),
    ) ); `

    I did add the Featured Page widget to this sidebar, but it doesn’t show up because I’m not using the home.php page. Here’s the code on the home.php page that I think should go on the functions.php page:
    `add_action( ‘genesis_meta’, ‘streamline_home_genesis_meta’ );
    /**
    * Add widget support for homepage.
    *
    */
    function streamline_home_genesis_meta() {

    if ( is_active_sidebar( ‘home-featured-1′ ) || is_active_sidebar( ‘home-featured-2′ ) || is_active_sidebar( ‘home-featured-3′ ) ) {

    add_action( ‘genesis_before_content_sidebar_wrap’, ‘streamline_home_loop_helper’ );

    }
    }

    /**
    * Display widget content for home featured sections.
    *
    */
    function streamline_home_loop_helper() {

    if ( is_active_sidebar( ‘home-featured-1′ ) || is_active_sidebar( ‘home-featured-2′ ) || is_active_sidebar( ‘home-featured-3′ ) ) {

    echo ”;

    echo ”;
    dynamic_sidebar( ‘home-featured-1′ );
    echo ‘‘;

    echo ”;
    dynamic_sidebar( ‘home-featured-2′ );
    echo ‘‘;

    echo ”;
    dynamic_sidebar( ‘home-featured-3′ );
    echo ‘‘;

    echo ‘‘;

    }

    }`

    This is the code that added the slider to the static page (page id 2), and this is the page where I’d like the Featured Page widget to show up above the slider:
    `add_action( ‘genesis_before_loop’, ‘child_before_content’);
    function child_before_content() {
    if ( is_page(2) ){ echo ”;
    dynamic_sidebar( ‘home-custom’ );
    echo ‘‘;
    }

    }
    `

    I hope that the above is concise enough to help.

    Thanks for your help,
    Bill

    #58714

    cehwitham
    Participant
    Post count: 396

    If you’re not using home.php could you add the code to front-page.php instead?


    Twitter: cehwitham Web: cehwitham.com

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.