Agency Theme Add Home Section

Community Forums Forums Design Tips and Tricks Agency Theme Add Home Section

This topic is: not resolved

This topic contains 11 replies, has 3 voices, and was last updated by  Helen 1 year, 9 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #17654

    Mack
    Participant
    Post count: 37

    I am trying to add home-left-center, middle-center, right-center and the same for bottom. I want 3 separate sections.

    I have registered the sidebars:

    genesis_register_sidebar( array(
    ‘id’ => ‘home-left-center’,
    ‘name’ => __( ‘Home Left-2′, ‘agency’ ),
    ‘description’ => __( ‘This is the second (2) middle section of the homepage.’, ‘agency’ ),
    ) );

    genesis_register_sidebar( array(
    ‘id’ => ‘home-middle-center’,
    ‘name’ => __( ‘Home Middle-2′, ‘agency’ ),
    ‘description’ => __( ‘This is the second (2) middle section of the homepage.’, ‘agency’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’ => ‘home-right-center’,
    ‘name’ => __( ‘Home Right-2′, ‘agency’ ),
    ‘description’ => __( ‘This is the second (2) right section of the homepage.’, ‘agency’ ),
    ) );

    I have added the CSS:

    /* Home———————————————————— */
    .home-center #inner {
    margin: 30px auto 0;
    }

    #home-center {
    font-size: 14px;
    }

    #home-center p {
    font-size: inherit;
    }

    .home-left-center {
    float: left;
    margin: 0 30px 0 0;
    width: 280px;
    }

    .home-middle-center {
    float: left;
    width: 280px;
    }

    .home-right-center {
    float: right;
    width: 280px;
    }

    I am struggling with the home page. This is what I have:

    function agency_home_loop_helper() {

    if ( is_active_sidebar( ‘home-left’ ) || is_active_sidebar( ‘home-middle’ ) || is_active_sidebar( ‘home-right’ )) {

    echo ‘<div id=”home”>’;

    echo ‘<div class=”home-left”>’;
    dynamic_sidebar( ‘home-left’ );
    echo ‘</div><!– end .home-left –>’;

    echo ‘<div class=”home-middle”>’;
    dynamic_sidebar( ‘home-middle’ );
    echo ‘</div><!– end .home-middle –>’;

    echo ‘<div class=”home-right”>’;
    dynamic_sidebar( ‘home-right’ );
    echo ‘</div><!– end .home-right –>’;

    echo ‘</div><!– end #home –>’;

    }

    }
    function agency_home_center_loop_helper() {

    if ( is_active_sidebar( ‘home-left-center’ ) || is_active_sidebar( ‘home-middle-center’ ) || is_active_sidebar( ‘home-right-center’ )) {

    echo ‘<div id=”home-center”>’;

    echo ‘<div class=”home-left-center”>’;
    dynamic_sidebar( ‘home-left-2′ );
    echo ‘</div><!– end .home-left-2 –>’;

    echo ‘<div class=”home-middle-center”>’;
    dynamic_sidebar( ‘home-middle-2′ );
    echo ‘</div><!– end .home-middle-2 –>’;

    echo ‘<div class=”home-right-center”>’;
    dynamic_sidebar( ‘home-right-2′ );
    echo ‘</div><!– end .home-right-2 –>’;
    echo ‘</div><!– end #home-center –>’;

    }

    }

    I really need some assistance. Thanks in advance for your help.

    Mack Biggs

    • This topic was modified 1 year, 9 months ago by  Mack.
    • This topic was modified 1 year, 9 months ago by  Mack.
    #17668

    SoZo
    Moderator
    Post count: 1573

    That’s not the entire home.php coder is it? Did you add the action which loads the function?


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #17681

    Mack
    Participant
    Post count: 37

    John,

    “Did you add the action which loads the function?”

    I wish I knew what that is????

    I need to have to more left, middle and right separate from each other.

    Here is a link: http://www.faganandassociatesinc.com

    As always, I appreciate your assistance!!

     

    Mack

    #17683

    SoZo
    Moderator
    Post count: 1573

    Take a look at steps 3 and 4 in the example here. And you can learn more about the add_action function here.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #18054

    Mack
    Participant
    Post count: 37

    I thought I did all of that. I just need to have two more rows, center and bottom of the home left, middle and right.

    This is now two days of pulling out my hair with this.

    I have registered the Widgets in the Functions and they appear correctly in the Widget Admin area.

    I tried the:

    genesis_widget_area( ‘home-left-center’, array( ‘before’ => ‘<div id=”home-left-center” class=”widget-area”>’ ) || ‘home-middle-center’, array( ‘before’ => ‘<div id=”home-middle-center” class=”widget-area”>’ ) || ‘home-right-center’, array( ‘before’ => ‘<div id=”home-right-center” class=”widget-area”>’ ));
    echo ‘<div id=”home-center”>’;

    echo ‘<div class=”home-left-center”>’;
    dynamic_sidebar( ‘home-left-center’ );
    echo ‘</div><!– end .home-left-center –>’;

    echo ‘<div class=”home-middle-center”>’;
    dynamic_sidebar( ‘home-middle-center’ );
    echo ‘</div><!– end .home-middle-center –>’;

    echo ‘<div class=”home-right-center”>’;
    dynamic_sidebar( ‘home-right-center’ );
    echo ‘</div><!– end .home-right-center –>’;

    echo ‘</div><!– end #home-center –>’;

    But no go!!

    #18112

    Mack
    Participant
    Post count: 37

    PS:

    I have the following in my functions.php

    genesis_register_sidebar( array(
    ‘id’ => ‘home-left-center’,
    ‘name’ => __( ‘Home Left-center’, ‘agency’ ),
    ‘description’ => __( ‘This is the second (center) left section of the homepage.’, ‘agency’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’ => ‘home-middle-center’,
    ‘name’ => __( ‘Home Middle-center’, ‘agency’ ),
    ‘description’ => __( ‘This is the second (center) middle section of the homepage.’, ‘agency’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’ => ‘home-right-center’,
    ‘name’ => __( ‘Home Right-center’, ‘agency’ ),
    ‘description’ => __( ‘This is the second (center) right section of the homepage.’, ‘agency’ ),
    ) );

    #18257

    SoZo
    Moderator
    Post count: 1573

    The original home loop is added with this add_action
    [php]
    add_action( ‘genesis_loop’, ‘agency_home_loop_helper’ );[/php]
    So you either need to add another one for your new function or move your divs in to the agency_home_loop_helper function.

    E.g.
    [php]add_action( ‘genesis_after_loop’, ‘agency_home_center_loop_helper’ );[/php]


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #18270

    Mack
    Participant
    Post count: 37

    Thanks John,

     

    Now the calendar (test for widget) appears in the same widget area as left,middle and center.

    How do I get it in it’s own container???? Or is it #inner??????

    For a coder this would take five minutes. I am on day 3 of trying to sort this out.

    Would be nice if there was a tutorial like this only specific for this theme and this requirement. I have seen several posts asking how to do this.

    They send folks to cryptic how to’s.

    None of this makes any sense to me.

    #18271

    SoZo
    Moderator
    Post count: 1573

    You should be able to use a different hook like genesis_before_footer


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #18283

    Mack
    Participant
    Post count: 37

    John,

    Thanks for your continued support!!

    I added this to functions.php:

    add_action(‘genesis_before_footer’, ‘child_home_center_after_loop’);

    I added this to home.php

    add_action( ‘genesis_before_footer’, ‘agency_home_center_loop_helper’ );

    Then placed this code in home.php:

    function agency_home_center_loop_helper() {
    if ( is_active_sidebar( ‘home-left-center’ ) || is_active_sidebar( ‘home-middle-center’ ) || is_active_sidebar( ‘home-right-center’ )) {

    echo ‘<div id=”home”>’;

    echo ‘<div class=”home-left-center”>’;
    dynamic_sidebar( ‘home-left-center’ );
    echo ‘</div><!– end .home-left –>’;

    The calendar is now just above the actual footer and below the footer widgets.

    I need it between the home left,middle, right and the footer widgets in it’s own #inner

    See it here: http://faganandassociatesinc.com/

    #18287

    Mack
    Participant
    Post count: 37

    I fixed the function: from: add_action(‘genesis_before_footer’, ‘child_home_center_after_loop’);

    to: add_action(‘genesis_before_footer’, ‘agency_home_center_after_loop’);

    Still the same.

    #19028

    Helen
    Participant
    Post count: 11

    Hello, I am trying to do the same thing, although not with adding new widget areas but with moving the home welcome and slider widgets to below the home left/middle/right widgets and I can move them, but they appear in the same widgget area as home left/middle/right, I also want them ina separate container like Mack is saying….. Have been fooling around with the css, but can’t figure it out…

    Has anyone been able to do this?

     

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

You must be logged in to reply to this topic.