Community Forums › Forums › Archived Forums › Design Tips and Tricks › Agency Theme Add Home Section
- This topic has 11 replies, 3 voices, and was last updated 11 years, 1 month ago by Helen.
-
AuthorPosts
-
February 3, 2013 at 1:44 pm #17654MackMember
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
February 3, 2013 at 2:47 pm #17668SoZoMemberThat'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
February 3, 2013 at 3:11 pm #17681MackMemberJohn,
"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
February 3, 2013 at 3:33 pm #17683SoZoMemberTake 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
February 4, 2013 at 4:36 pm #18054MackMemberI 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!!
February 4, 2013 at 6:44 pm #18112MackMemberPS:
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' ),
) );February 5, 2013 at 12:45 pm #18257SoZoMemberThe original home loop is added with this add_action
add_action( 'genesis_loop', 'agency_home_loop_helper' );
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.
add_action( 'genesis_after_loop', 'agency_home_center_loop_helper' );
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
February 5, 2013 at 1:00 pm #18270MackMemberThanks 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.
February 5, 2013 at 1:01 pm #18271SoZoMemberYou should be able to use a different hook like genesis_before_footer
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
February 5, 2013 at 1:33 pm #18283MackMemberJohn,
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/
February 5, 2013 at 1:54 pm #18287MackMemberI 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.
February 8, 2013 at 1:52 pm #19028HelenMemberHello, 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?
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.