Community Forums › Forums › Design Tips and Tricks › Enterprise Theme – How do i create a new widget area below home-middle 1,2,3?
Tagged: Enterpreis Text Widget Area
This topic contains 1 reply, has 1 voice, and was last updated by weborganizing 6 months ago.
-
AuthorPosts
-
December 16, 2012 at 8:28 am #5529
Hello StudioPress Community,
since 3 days i try to ralize my design for a friend of mine. I use the Enterpris Theme and i registered a new widget area in the functions.php like this:
genesis_register_sidebar( array(
‘id’ => ‘home-booking-1′,
‘name’ => __( ‘Home Booking’, ‘enterprise’ ),
‘description’ => __( ‘Area for Textwidget’, ‘enterprise’ ),
) );It works! I have a new Widget Area and i put the “text widget” in it.
Now i want to display it, like the design.jpg and i can´t figure out how to this in a correct way. I played around with genesis_after_content and so on…
Totally at the end of my home.php file i put this code in it:
….
echo ‘</div><!– end #home-middle –>’;
}add_action( ‘genesis_after_content_sidebar_wrap’, ‘child_after_content_ad_sidebar’ );
/** Loads a new sidebar after the content */
function child_after_content_ad_sidebar() {echo ‘<div>’;
dynamic_sidebar( ‘home-booking-1′ );
echo ‘</div>’;}
genesis();
The only result i can ralize ist this: click.
In my style.css i put this rows in it – also at the end:
/* Ad Sidebar
———————————————————— */.home-booking-1 { border-bottom: 1px dotted #ccc; list-style-type: none; margin: 0 0 3px; padding: 0 0 3px 5px; word-wrap: break-word; }
Thank you very much for any ideas….
I don´t know anything abaout php (ecxept the last 3 days) – so i hope my trial and error expirience comes to an end here…
Best regards,
Jack
December 16, 2012 at 8:59 am #5535This is my home.php file:
<!–?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 ”;
if ( is_active_sidebar( ‘home-top-1′ ) ) {
echo ”;
dynamic_sidebar( ‘home-top-1′ );
echo ‘‘;
}echo ”;
if ( function_exists( ‘wp_cycle’ ) )
wp_cycle();
echo ‘‘;
echo ‘‘;}
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 ”;
if ( is_active_sidebar( ‘home-middle-1′ ) ) {
echo ”;
dynamic_sidebar( ‘home-middle-1′ );
echo ‘‘;
}if ( is_active_sidebar( ‘home-middle-2′ ) ) {
echo ”;
dynamic_sidebar( ‘home-middle-2′ );
echo ‘‘;
}if ( is_active_sidebar( ‘home-middle-3′ ) ) {
echo ”;
dynamic_sidebar( ‘home-middle-3′ );
echo ‘‘;
}echo ‘‘;
}add_action( ‘genesis_after_content_sidebar_wrap’, ‘child_after_content_ad_sidebar’ );
/** Loads a new sidebar after the content */
function child_after_content_ad_sidebar() {echo ”;
dynamic_sidebar( ‘home-booking-1′ );
echo ”;}
genesis();
-
AuthorPosts
You must be logged in to reply to this topic.