Community Forums › Forums › Archived Forums › Design Tips and Tricks › Enterprise Theme – how do I add a full width widget area above home1,2,3?
- This topic has 1 reply, 2 voices, and was last updated 10 years, 7 months ago by Brad Dalton.
-
AuthorPosts
-
August 16, 2013 at 2:21 pm #56883BesearchedMember
I have been struggling with adding a widget area above the home-middle section. It is there... and shows up....above the header 🙁 . I just can't figure out what I am missing to get it to the right place.
Here is my home.php :
<?php/**
* This file handles the output on the homepage.
*/
add_action( 'genesis_after_header', 'enterprise_home_top_helper' );
/**
* Conditionally add Home Top #1 (home-top-1) sidebar and WP-Cycle.
*/
function enterprise_home_top_helper() {
echo '<div id="home-top-bg"><div id="home-top"><div class ="wrap">';
if ( is_active_sidebar( 'home-top-1' ) ) {
echo '<div class="home-top-1">';
dynamic_sidebar( 'home-top-1' );
echo '</div><!-- end .home-top-1 -->';
}
echo '<div class="home-top-2">';
if ( function_exists( 'soliloquy_slider' ) ) soliloquy_slider( '52' );
echo '</div><!-- end .home-top-2 -->';
echo '</div><!-- end .wrap --></div><!-- end #home-top --></div><!-- end #home-top-bg -->';
}
echo '<div id="home-center">';
if ( is_active_sidebar( 'home-center' ) ) {
echo '<div class="home-center">';
dynamic_sidebar( 'home-center' );
echo '</div><!-- end .home-center -->';
}
echo '</div><!-- end #home-center -->';
add_action( 'genesis_meta', 'enterprise_home_genesis_meta' );
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
*/
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' );
}
}
function enterprise_home_loop_helper() {
echo '<div id="home-middle">';
if ( is_active_sidebar( 'home-middle-1' ) ) {
echo '<div class="home-middle-1">';
dynamic_sidebar( 'home-middle-1' );
echo '</div><!-- end .home-middle-1 -->';
}
if ( is_active_sidebar( 'home-middle-2' ) ) {
echo '<div class="home-middle-2">';
dynamic_sidebar( 'home-middle-2' );
echo '</div><!-- end .home-middle-2 -->';
}
if ( is_active_sidebar( 'home-middle-3' ) ) {
echo '<div class="home-middle-3">';
dynamic_sidebar( 'home-middle-3' );
echo '</div><!-- end .home-middle-3 -->';
}
echo '</div><!-- end #home-middle -->';
}
genesis();
And here is my CSS for my widget area (home-center)
/* Home Center
------------------------------------------------------------ */#home-center {
background: url(images/quotebackground.png);
height: 150px;
margin: 0 auto;
padding: 5px 0 5px 0;
width: 960px;
}.home-center {
float: left;
padding: 5px;
width: 960px;}
I know I'm not missing it by much...and any help would be awesome. Here is the site link:
http://besearched.biz/infinitymoving/
http://besearched.biz/infinitymoving/August 16, 2013 at 2:46 pm #56891Brad DaltonParticipantHi
What's the widget for?
Do you want it to display site wide or only on specific pages?
Which hook position?
This is the code you would use and modify:
Please copy the code from the view raw link and
paste it at the end of your child themes functions.php file
using a text editor like Notepad++You may need to change or remove the conditional tag and hook position
Try changing genesis_loop to genesis_before_content_sidebar_wrap
Have you also considered updating your theme?
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.