Community Forums › Forums › Archived Forums › General Discussion › Add Featured Pages to Already Altered Static Homepage in Streamline
- This topic has 3 replies, 2 voices, and was last updated 10 years, 8 months ago by cehwitham.
-
AuthorPosts
-
April 30, 2013 at 11:47 am #38598swansonwcMember
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/
`June 2, 2013 at 5:35 pm #43709cehwithamMemberHave you added the Featured Page widget into the sidebar you created?
Chris
Twitter: cehwitham Web: cehwitham.com
June 3, 2013 at 7:56 am #43811swansonwcMemberChris,
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,
BillAugust 25, 2013 at 7:01 am #58714cehwithamMemberIf you're not using home.php could you add the code to front-page.php instead?
Twitter: cehwitham Web: cehwitham.com
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.