enterprise child theme with both widget and posts into the home page

Community Forums Forums Design Tips and Tricks enterprise child theme with both widget and posts into the home page

This topic is: not resolved

This topic contains 14 replies, has 2 voices, and was last updated by  cehwitham 1 year, 9 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #21343

    tsolignani
    Participant
    Post count: 7

    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

    http://blog.solignani.it

    #21438

    cehwitham
    Participant
    Post count: 396

    I 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

    #21604

    tsolignani
    Participant
    Post count: 7

    Thank 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

    http://blog.solignani.it

    #21711

    cehwitham
    Participant
    Post count: 396

    I 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

    #21908

    tsolignani
    Participant
    Post count: 7

    Thank 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

    http://blog.solignani.it

     

     

    #21923

    cehwitham
    Participant
    Post count: 396

    Ypu’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

    #21967

    tsolignani
    Participant
    Post count: 7

    That’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’ ),
    ) );

    #21974

    cehwitham
    Participant
    Post count: 396

    In 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

    #22168

    tsolignani
    Participant
    Post count: 7

    Thank 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

    http://blog.solignani.it

    #22187

    cehwitham
    Participant
    Post count: 396

    Try 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

    #22192

    tsolignani
    Participant
    Post count: 7
    #22197

    cehwitham
    Participant
    Post count: 396

    The 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

    #22201

    tsolignani
    Participant
    Post count: 7

    Dropbox 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

    http://blog.solignani.it

    #22204

    tsolignani
    Participant
    Post count: 7

    Now it works, sorry for the delay.

    Thank you.

     
    –
cordialmente,

    tiziano solignani, da  Mac

    http://blog.solignani.it

    #22213

    cehwitham
    Participant
    Post count: 396

    That 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

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

You must be logged in to reply to this topic.