Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding new widget area (Agency Theme)
Tagged: Add Extra Widgets., Agency Widgets
- This topic has 8 replies, 5 voices, and was last updated 11 years, 10 months ago by
matryx.
-
AuthorPosts
-
November 16, 2012 at 4:11 pm #368
halestorm
MemberHello,
I'm trying to add a new widget area in the Agency Theme. I'm not very well versed in PHP so I'm not 100% sure what to do.
I did the functions thing. It's in the widget area. All good.
But it's not displaying on the home page the way I want it.
I want it to appear under the 3 home left, center, and right area in it's own bubble.
Here is how I have the code in home.php:
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>';
dynamic_sidebar( 'home-left' );
echo '</div><!-- end .home-left -->';
echo '<div>';
dynamic_sidebar( 'home-middle' );
echo '</div><!-- end .home-middle -->';
echo '<div>';
dynamic_sidebar( 'home-right' );
echo '</div><!-- end .home-right -->';
echo '</div><!-- end #home -->';
}
if ( is_active_sidebar( 'home-banner' ) ) {
echo '<div id="home-banner">';
dynamic_sidebar( 'home-banner' );
echo '</div><!-- end #home-banner -->';
}
}
So the way it's displaying now is the widget I'm trying to add is INSIDE the bubble that the 3 other widgets are.
I want it outside that bubble just under it. I'm thinking I need to add another function agency_home_loop_helper() type call but I have no idea what. I'm sure it's something simple I'm missing..
Any help would be great! Here is the site in question: http://174.132.169.61/~wsiebiz/
Thanks,
DanielNovember 16, 2012 at 4:56 pm #372Jon Weiss
MemberLooks to me like you want to pop that outside the content area, rather than have it display within the content div. There are several ways to do it, all of which are fine for your purposes. Let me know if you need further help and I'll try to put some code together for you when I have a minute.
November 16, 2012 at 5:06 pm #378halestorm
MemberYeah I tried what you are saying and I put the code of the widget (at least what I think is the widget out side of the what I think is just the area below the 3 middle widget but now the banner is on the top. Just not 100% sure what I'm missing. Here is what I did:
<code>
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 -->';
}
}
if ( is_active_sidebar( 'home-banner' ) ) {
echo '<div id="home-banner">';
dynamic_sidebar( 'home-banner' );
echo '</div><!-- end #home-banner -->';
}
</code>
November 16, 2012 at 5:35 pm #382halestorm
MemberHere is the code for the whole home.php if that helps.
<?phpadd_action( 'genesis_meta', 'agency_home_genesis_meta' );
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
*/
function agency_home_genesis_meta() {
if ( is_active_sidebar( 'home-welcome' ) || is_active_sidebar( 'home-slider' ) || is_active_sidebar( 'home-left' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-right' ) ) {
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_after_header', 'agency_home_welcome_helper' );
add_action( 'genesis_loop', 'agency_home_loop_helper' );
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[] = 'agency';
return $classes;
}
}
}
function agency_home_welcome_helper() {
if ( is_active_sidebar( 'home-welcome' ) ) {
echo '';
dynamic_sidebar( 'home-welcome' );
echo '';
}
if ( is_active_sidebar( 'home-slider' ) ) {
echo '';
dynamic_sidebar( 'home-slider' );
echo '';
}
}
function agency_home_loop_helper() {
if ( is_active_sidebar( 'home-left' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-right' ) ) {
echo '';
echo '';
dynamic_sidebar( 'home-left' );
echo '';
echo '';
dynamic_sidebar( 'home-middle' );
echo '';
echo '';
dynamic_sidebar( 'home-right' );
echo '';
echo '';
}
}
if ( is_active_sidebar( 'home-banner' ) ) {
echo '';
dynamic_sidebar( 'home-banner' );
echo '';
}
genesis();
November 28, 2012 at 1:26 pm #2080halestorm
MemberI think this got buried... So I'm refreshing it...
November 29, 2012 at 1:43 pm #2367[email protected]
MemberI have the same issue. What is the solution?
November 29, 2012 at 9:48 pm #2455[email protected]
MemberNever mind......issue fixed.
January 16, 2013 at 10:26 pm #12562ChicGeek
MemberHi,
Trying to do the same as described above. I need to duplicate the home-right, middle and left and the bubble. Was able to add the extra widgets, but they appeared below and not in their own bubble.
Can someone post the solution. Any help appreciated!
Thanks,
Elisha
The Pixel Spot ♥ A Recommended STUDIOPRESS Customizer ♥ I Tweet
Genesis Junkie + Web & Graphic Designer + Ad World Girl + Student of Life
March 21, 2013 at 6:25 pm #30334matryx
MemberHi Everyone
I am trying to add a new full size widget area under the three content boxes. I can register the widget with out any problems in the function.php but I really do not know where to add the code on the Home.php
The code for the functions file...
genesis_register_sidebar( array(
'id' => 'home-optin',
'name' => __( 'Home Three', 'agency' ),
'description' => __( 'This is the optin section of the homepage.', 'agency' ),
) );The new widget needs to be the same width as the slider but under the content boxes and above the footer widgets you can see the site here - http://www.buzinga.com.au/
Do I need to add the || is_active_sidebar( 'home-optin' ) to this line
function agency_home_genesis_meta() {
if ( is_active_sidebar( 'home-welcome' ) || is_active_sidebar( 'home-slider' ) || is_active_sidebar( 'home-left' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-right' ) ) {
and also this line
function agency_home_loop_helper() {
if ( is_active_sidebar( 'home-left' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-right' ) ) {
I have tried doing this but I end up with the widget at the top of the page any help would be appreciated.
Ron
Full Time Online Marketer and website creation.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.