Community Forums › Forums › Design Tips and Tricks › add widget-wrap (alignment issue)
This topic contains 2 replies, has 2 voices, and was last updated by moneyfunk 3 months ago.
-
AuthorPosts
-
February 15, 2013 at 4:22 pm #20602
I took the elements from the Blissful ( ‘home-top’ ) and added them to the Lifestyle home page. but I cannot get the thumbnails to align horizontally, like in the blissful demo. Please help.
http://www.test.oatmeal-bowl.com
1. first I added “dynamic sidebar (home-top)” to the home.php
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
*/
function lifestyle_home_loop_helper() {
if ( is_active_sidebar( ‘home’ ) || is_active_sidebar( ‘home-left’ ) || is_active_sidebar( ‘home-right’ ) ) {
dynamic_sidebar( ‘home’ );
dynamic_sidebar ( ‘home-top’ );if ( is_active_sidebar( ‘home-left’ ) ) {
echo ‘<div id=”homepage-left”>’;
dynamic_sidebar( ‘home-left’ );
echo ‘</div><!– end #homepage-left –>’;
}
if ( is_active_sidebar( ‘home-right’ ) ) {
echo ‘<div id=”homepage-right”>’;
dynamic_sidebar( ‘home-right’ );
echo ‘</div><!– end #homepage-right –>’;
}}
else {
genesis_standard_loop();
}}
2. added to the functions.php
genesis_register_sidebar( array(
‘id’ => ‘home-top’,
‘name’ => __( ‘Home Top’, ‘blissful’ ),
‘description’ => __( ‘This is the top section of the homepage’, ‘blissful’ ),
) );
3. completed with
#content .widget-wrap {
margin: 0 0 20px;
overflow: hidden;
}
Christine
http://www.oatmealinmybowl.com | Twitter: @OatmealBowlFebruary 15, 2013 at 5:10 pm #20606Hello, you’ll have to add float: left to their css styles.
around line 1282 in your child-theme css you’ll see:
.featuredpage .page,
.featuredpost .post {
margin: 0 0 10px;
overflow: hidden;
padding: 5px 0;
}
You can add “float: left;”, and then adjust your margins to space them out and that will take care of it.
I’m not sure how that may affect other pages, so it might be better to add a style just for the home page:
.home .featuredpost .post {
margin: 0 xxpx 10px; /* adjust your margin here */
float: left;
}
If that affects something else that you don’t want changes, you can be really specific and use #featured-post-14 .post instead.
Tony Eppright | http://www.AlphaBlossom.com
February 15, 2013 at 5:50 pm #20609I realized later that I didn’t have the <div=”widget-wrap”> elements around the ( ‘home-top’ ). Then when i tried to updated in the home.php file…
I used this:
if ( is_active_sidebar( ‘home-top’ ) ) {
echo ‘<div id=”widget-wrap”>’;
dynamic_sidebar( ‘home-top’ );
echo ‘</div>’;
}it wrapped the ‘widget-wrap’ around each featured post(s) and not as a collective element.
Your .home solution worked w/out affecting any other elements. Going to play with the margins in a bit.
Thank you, Tony! I appreciate it.
Christine
http://www.oatmealinmybowl.com | Twitter: @OatmealBowl -
AuthorPosts
You must be logged in to reply to this topic.