Forum Replies Created
-
AuthorPosts
-
stfnMember
Just one additional quote. If you want this effect only for your homepage and let the other pages with the fixed with, you should use the following code in your CSS
.home .site-inner{ max-width: none; padding: 0; } .site-inner, .wrap { margin: 0 auto; max-width: 1280px; }
stfnMemberAha. Strange you can't send someone a private message this way. I see it also in the forum FAQ.
I've got a yahoo mail address: stefan2013 - and you can guess the rest 😉
stfnMemberThis reply has been marked as private.stfnMemberHi Pyramid Web,
thank you very much for your input. Unfortunately it doesn't work. I still can't get the widgets with one background in full width.This is what I'm trying to accomplish, see img (with the two white widgets on the blue background)
stfnMemberYes, I understand. I've fixed that. See code below for the front-page.php
<?php /** * This file adds the Front Page Template to any Genesis Child Theme. */ add_action( 'genesis_meta', 'bakker_home_genesis_meta' ); /** * Add widget support for homepage. If no widgets active, display the default loop. * */ function bakker_home_genesis_meta() { if ( is_active_sidebar( 'home-middle-1' ) || is_active_sidebar( 'home-middle-2' ) || is_active_sidebar( 'home-middle-3' ) || is_active_sidebar( 'home_bottom-1' ) || is_active_sidebar( 'home_bottom-2' ) ) { remove_action( 'genesis_loop', 'genesis_do_loop' ); add_action( 'genesis_loop', 'bakker_home_middle',5 ); add_action( 'genesis_loop', 'bakker_home_bottom',10 ); add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); add_filter( 'body_class', 'add_body_class' ); function add_body_class( $classes ) { $classes[] = 'bakkerwidget'; return $classes; } } } function bakker_home_middle() { genesis_widget_area( 'home-middle-1', array( 'before' => '<div id="home-middle" class="home-middle"><div id="home-middle-1" class="home-middle-1"><div class="wrap">', 'after' => '</div></div>', ) ); genesis_widget_area( 'home-middle-2', array( 'before' => '<div id="home-middle-2" class="home-middle-2"><div class="wrap">', 'after' => '</div></div>', ) ); genesis_widget_area( 'home-middle-3', array( 'before' => '<div id="home-middle-3" class="home-middle-3"><div class="wrap">', 'after' => '</div></div></div>', ) ); } function bakker_home_bottom() { genesis_widget_area( 'home-bottom-1', array( 'before' => '<div id="home-bottom" class="home-bottom"><div id="home-bottom-1" class="home-bottom-1"><div class="wrap">', 'after' => '</div></div>', ) ); genesis_widget_area( 'home-bottom-2', array( 'before' => '<div id="home-bottom-2" class="home-bottom-2"><div class="wrap">', 'after' => '</div></div></div>', ) ); } genesis();
But I still can't get the full width background to one color for the two widgets (home-bottom). I only can get the total widget area one color (full width color for all 5 widgets since this is a body class). I want the background of the two widgets change in one color background, just like the navigation or like the footer. How can I do this?
stfnMemberHi Victor,
thanks for your feedback. I really appreciate your help. But it doesn't seem to work, since the widgets are now on top of the page. Maybe it helps when I show the whole code.This is my total code for the front-page.php
<?php /** * This file adds the Front Page Template to any Genesis Child Theme. */ add_action( 'genesis_meta', 'bakker_home_genesis_meta' ); /** * Add widget support for homepage. If no widgets active, display the default loop. * */ function bakker_home_genesis_meta() { if ( is_active_sidebar( 'home-middle-1' ) || is_active_sidebar( 'home-middle-2' ) || is_active_sidebar( 'home-middle-3' ) || is_active_sidebar( 'home_bottom-1' ) || is_active_sidebar( 'home_bottom-2' ) ) { remove_action( 'genesis_loop', 'genesis_do_loop' ); add_action( 'genesis_loop', 'bakker_home_loop_helper',5 ); add_action( 'genesis_loop', 'bakker_home_bottom',10 ); add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); add_filter( 'body_class', 'add_body_class' ); function add_body_class( $classes ) { $classes[] = 'bakkerwidget'; return $classes; } } } function bakker_home_loop_helper() { if ( is_active_sidebar( 'home-middle-1' ) ) { echo '<div class="one-third first">'; dynamic_sidebar( 'home-middle-1' ); echo '</div><!-- end .home-middle-1 -->'; } if ( is_active_sidebar( 'home-middle-2' ) ) { echo '<div class="one-third">'; dynamic_sidebar( 'home-middle-2' ); echo '</div><!-- end .home-middle-2 -->'; } if ( is_active_sidebar( 'home-middle-3' ) ) { echo '<div class="one-third">'; dynamic_sidebar( 'home-middle-3' ); echo '</div><!-- end .home-middle-3 -->'; } echo '</div><!-- end .home-middle -->'; } function bakker_home_bottom() { if ( is_active_sidebar( 'home-bottom-1' ) ) { echo '<div id="home-bottom-1"><div class="one-half first">'; dynamic_sidebar( 'home-bottom-1' ); echo '</div><!-- end .home-bottom-1 -->'; } if ( is_active_sidebar( 'home-bottom-2' ) ) { echo '<div id="home-bottom-2"><div class="one-half">'; dynamic_sidebar( 'home-bottom-2' ); echo '</div><!-- end .home-bottom-2 -->'; } echo '</div><!-- end .home-bottom -->'; } genesis();
and this is the code for the functions.php
genesis_register_sidebar( array( 'id' => 'home-middle-1', 'name' => __( 'Home Middle #1', 'bakkerwidget' ), 'description' => __( 'This is the first column of the home middle section.', 'bakkerwidget' ), ) ); genesis_register_sidebar( array( 'id' => 'home-middle-2', 'name' => __( 'Home Middle #2', 'bakkerwidget' ), 'description' => __( 'This is the second column of the home middle section.', 'bakkerwidget' ), ) ); genesis_register_sidebar( array( 'id' => 'home-middle-3', 'name' => __( 'Home Middle #3', 'bakkerwidget' ), 'description' => __( 'This is the third column of the home middle section.', 'bakkerwidget' ), ) ); genesis_register_sidebar( array( 'id' => 'home-bottom-1', 'name' => __( 'Home Bottom #1', 'bakkerwidget' ), 'description' => __( 'This is the first column of the home bottom section.', 'bakkerwidget' ), ) ); genesis_register_sidebar( array( 'id' => 'home-bottom-2', 'name' => __( 'Home Bottom #2', 'bakkerwidget' ), 'description' => __( 'This is the second column of the home bottom section.', 'bakkerwidget' ), ) );
-
AuthorPosts