Community Forums › Forums › Archived Forums › Design Tips and Tricks › enterprise child theme with both widget and posts into the home page
Tagged: Enterprise, genesis, home
- This topic has 14 replies, 2 voices, and was last updated 11 years, 8 months ago by cehwitham.
-
AuthorPosts
-
February 19, 2013 at 9:41 am #21343tsolignaniMember
I am on genesis and enterprise child them, both updated to the last versions. I wonder if I can add both Home middle and Footer widgets while keeping post excerpts into the home page. As a matter of fact, if I enable footers the posts keep showing, but when I enable the home middle widgets too, the posts disappear and the home page is made up only with widgets. My blog is http://blog.solignani.it. I wrote to support and was told I have to edit the home.php file but that's beyond me. I wonder if anyone did the same or could gave me some hint or code snippet to try. Thank you.
– cordialmente,
tiziano solignani, da Mac
February 19, 2013 at 2:20 pm #21438cehwithamMemberI don't have the theme installed to test it but looking at the home.php file for the Enterprise theme I think you need to find:
function enterprise_home_genesis_meta() {
if ( is_active_sidebar( 'home-middle-1' ) || is_active_sidebar( 'home-middle-2' ) || is_active_sidebar( 'home-middle-3' ) ) {
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'enterprise_home_loop_helper' );
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );}
}And change it to:
function enterprise_home_genesis_meta() {
if ( is_active_sidebar( 'home-middle-1' ) || is_active_sidebar( 'home-middle-2' ) || is_active_sidebar( 'home-middle-3' ) ) {
add_action( 'genesis_loop', 'enterprise_home_loop_helper', 1 );
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );}
}Make sure you delete the remove_action line.
Let me know how you get on.
Twitter: cehwitham Web: cehwitham.com
February 20, 2013 at 3:57 am #21604tsolignaniMemberThank you.
It does work, but it removes the primay sidebar, the one on the right, from the home page, while I would like to keep it as well.
Is there any way, to your knowledge?
Should you need to have a look, I can temporarily enable one widget in the home middle, just tell me.
Again, many thanks.
– cordialmente,tiziano solignani, da Mac
February 20, 2013 at 12:16 pm #21711cehwithamMemberI think if you remove the following line of code from the code I gave you above it should put the sidebar back:
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
So you should have:
if ( is_active_sidebar( 'home-middle-1' ) || is_active_sidebar( 'home-middle-2' ) || is_active_sidebar( 'home-middle-3' ) ) {
add_action( 'genesis_loop', 'enterprise_home_loop_helper', 1 );
}
}
Twitter: cehwitham Web: cehwitham.com
February 21, 2013 at 3:14 am #21908tsolignaniMemberThank you. It works.
Still... It's not just what I would like to have.
If you have a look at my home page, at http://blog.solignani.it, you see the 3 footers are graphically separated from the rest of the page, in a shadow of their own.
Whereas the home middle are glued together with posts. That's not only an eye issue, I cannot put the third widget, if I did it would get displayed at the bottom of the second one.
What I would like to obtain is an home page where the home middle widgets stay into a bubble of their own, like the footer ones, separated from both posts and primary sidebar.
Do you think I can do it?
Thanks again, and let me know if and how I can acknowledge your help into the matter.
– cordialmente,tiziano solignani, da Mac
February 21, 2013 at 5:57 am #21923cehwithamMemberYpu'll need to find where the middle widgets are being hooked into the template then unhook them and add them back in before_content_sidebar_wrap.
You should then be able to style them in a separate bubble, maybe copy the styles from the footer widgets?
This might be useful: http://my.studiopress.com/docs/hook-reference/
Chris
Twitter: cehwitham Web: cehwitham.com
February 21, 2013 at 9:20 am #21967tsolignaniMemberThat's a bit beyond me.
This is what I got into functions.php, is that useful?
<?php
/** Start the engine */
require_once( TEMPLATEPATH . '/lib/init.php' );/** Child theme (do not remove) */
define( 'CHILD_THEME_NAME', 'Enterprise Theme' );
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/enterprise' );$content_width = apply_filters( 'content_width', 600, 420, 900 );
/** Add new featured image sizes */
add_image_size('mini', 65, 65, TRUE);
add_image_size('homepage', 270, 80, TRUE);
add_image_size('slideshow', 600, 235, TRUE);/** Add support for post formats */
add_theme_support( 'post-formats', array(
'aside',
'audio',
'chat',
'gallery',
'image',
'link',
'quote',
'status',
'video'
) );
/** Add support for custom background */
add_custom_background();/** Add support for custom header */
add_theme_support( 'genesis-custom-header', array( 'width' => 960, 'height' => 120, 'textcolor' => '333', 'admin_header_callback' => 'enterprise_admin_style' ) );/**
* Register a custom admin callback to display the custom header preview with the
* same style as is shown on the front end.
*
*/
function enterprise_admin_style() {$headimg = sprintf( '.appearance_page_custom-header #headimg { background: url(%s) no-repeat; font-family: Droid Sans, arial, serif; min-height: %spx; }', get_header_image(), HEADER_IMAGE_HEIGHT );
$h1 = sprintf( '#headimg h1, #headimg h1 a { color: #%s; font-size: 36px; font-weight: normal; line-height: 42px; margin: 25px 0 0; text-decoration: none; }', esc_html( get_header_textcolor() ) );
$desc = sprintf( '#headimg #desc { color: #%s; }', esc_html( get_header_textcolor() ) );printf( '<style type="text/css">%1$s %2$s %3$s</style>', $headimg, $h1, $desc );
}
/** Add support for 3-column footer widgets */
add_theme_support( 'genesis-footer-widgets', 3 );/** Register widget areas */
genesis_register_sidebar( array(
'id' => 'home-top-1',
'name' => __( 'Home Top #1', 'enterprise' ),
'description' => __( 'This is home top #1 section.', 'enterprise' ),
) );
genesis_register_sidebar( array(
'id' => 'home-top-2',
'name' => __( 'Home Top #2', 'enterprise' ),
'description' => __( 'This is home top #2 section.', 'enterprise' ),
) );
genesis_register_sidebar( array(
'id' => 'home-middle-1',
'name' => __( 'Home Middle #1', 'enterprise' ),
'description' => __( 'This is home middle #1 section.', 'enterprise' ),
) );
genesis_register_sidebar( array(
'id' => 'home-middle-2',
'name' => __( 'Home Middle #2', 'enterprise' ),
'description' => __( 'This is home middle #2 section.', 'enterprise' ),
) );
genesis_register_sidebar( array(
'id' => 'home-middle-3',
'name' => __( 'Home Middle #3', 'enterprise' ),
'description' => __( 'This is home middle #3 section.', 'enterprise' ),
) );February 21, 2013 at 9:38 am #21974cehwithamMemberIn the code I got you to change above in home.php change:
add_action( 'genesis_loop', 'enterprise_home_loop_helper', 1 );
to
add_action( 'genesis_before_content_sidebar_wrap', 'enterprise_home_loop_helper', 1 );
Twitter: cehwitham Web: cehwitham.com
February 22, 2013 at 2:58 am #22168tsolignaniMemberThank you.
Almost there! Now I can display all three widget, only they are not in a bubble on their own.
Anyway, thanks again, it's much better now. I left it on line, should you wish to have a look.
Have a nice day.
– cordialmente,tiziano solignani, da Mac
February 22, 2013 at 4:39 am #22187cehwithamMemberTry making it:
add_action( 'genesis_after_header', 'enterprise_home_loop_helper' );
That should split it out of the #inner wrapper.
Twitter: cehwitham Web: cehwitham.com
February 22, 2013 at 4:56 am #22192tsolignaniMemberYes, but the result is ...
https://dl.dropbox.com/u/134544/Schermata%202013-02-22%20alle%2011.45.25.png
February 22, 2013 at 5:09 am #22197cehwithamMemberThe Dropbox file isn't working. Once you've moved it out of #inner, you'll need to style it up to match the footer widgets as I mentioned previously.
Chris
Twitter: cehwitham Web: cehwitham.com
February 22, 2013 at 5:15 am #22201tsolignaniMemberDropbox is still uploading it, please get back in 5 minutes (I have no idea how come is taking so long, the file is small).
The issue is not a style one, but a structure, to me.
Thanks.
– cordialmente,tiziano solignani, da Mac
February 22, 2013 at 5:40 am #22204tsolignaniMemberFebruary 22, 2013 at 7:03 am #22213cehwithamMemberThat looks fine, it's above the #inner wrap so you can style it separately.
I suggest you look at line 1443 in style.css where #footer-widgets is defined and you can copy of of the styles from that.
Without seeing it live on your site I can't advise further on exactly what the styles need to be.
Twitter: cehwitham Web: cehwitham.com
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.