Community Forums › Forums › Archived Forums › Design Tips and Tricks › Extra sidebar area pushes content down
Tagged: content, extra sidebars, sidebars
- This topic has 6 replies, 2 voices, and was last updated 11 years, 8 months ago by Elaine Griffin.
-
AuthorPosts
-
April 1, 2013 at 12:47 pm #32486Elaine GriffinMember
Hello,
I have added a wide sidebar above my regular sidebars, and it is pushing my content down, the height of the new sidebar. The only way I can get it back up even with the sidebars is to negative margin in the #content-sidebar-wrap, but then it brings the new sidebar up that amount too.
I have been wracking my brain trying to fix this. I'm guessing it's a simple thing I am over-thinking.
The site is http://www.retro-food.com
Thanks for any help!
Elaine
April 1, 2013 at 3:23 pm #32524Brian BournMemberLooks to me like you may have used the wrong hook to add the sidebar. To add a widget area above primary sidebar I use the following hook:
add_action( 'genesis_before_sidebar_widget_area', 'your_function_name' );
Bourn Creative | bourncreative.com | Twitter
April 2, 2013 at 7:51 am #32630Elaine GriffinMemberThanks Brian. I added my hook to the genesis_before_sidebar hook.
<div class="before-sidebar-ads">
<?php dynamic_sidebar( 'before-sidebar-ads' ); ?>
</div>And now it is not showing up at all. Here is what I have in my functions file:
/**add a new sidebar**/
genesis_register_sidebar( array(
'id' => 'before-sidebar-ads',
'name' => 'Before Sidebar Ads',
'description' => 'This is a sidebar that goes before the sidebar.',
) );
/** Loads a new sidebar before the sidebar */
function child_before_sidebar() {
echo '<div class="before-sidebar-ads">';
dynamic_sidebar( 'before-sidebar-ads' );
echo '</div>';
}
genesis_register_sidebar( array(
'id' => 'after-content-widgets',
'name' => 'After Content widgets',
'description' => 'This is a sidebar that goes after the content.',
) );I'm so confused. Every time I think I have a handle on registering sidebars and using hooks, I need help!
April 2, 2013 at 8:55 pm #32772Brian BournMemberThis is one way you can do it in your functions file:
add_action( 'genesis_before_sidebar_widget_area', 'child_before_sidebar' ); function child_before_sidebar() { echo '<div class="before-sidebar-ads">'; dynamic_sidebar( 'before-sidebar-ads' ); echo '</div>'; }
Bourn Creative | bourncreative.com | Twitter
April 2, 2013 at 8:57 pm #32774Brian BournMemberYou'll also still need to register the widget like you already have.
Bourn Creative | bourncreative.com | Twitter
April 3, 2013 at 9:42 am #32837Elaine GriffinMemberHmmm, that gave me the white screen of death.
April 5, 2013 at 11:55 am #33338Elaine GriffinMemberI'm still stuck on this, if anyone can help at all.
I have this in the before_sidebar hook:
<div class=”before-sidebar-ads”> <?php dynamic_sidebar( ‘before-sidebar-ads’ ); ?> </div>
Here is what I have in my functions file:
/**add a new sidebar**/ genesis_register_sidebar( array( ‘id’ => ‘before-sidebar-ads’, ‘name’ => ‘Before Sidebar Ads’, ‘description’ => ‘This is a sidebar that goes before the sidebar.’, ) ); /** Loads a new sidebar before the sidebar */ function child_before_sidebar() { echo ‘<div class="before-sidebar-ads”>’; dynamic_sidebar( ‘before-sidebar-ads’ ); echo ‘</div>’; }
I see the sidebar in my dashboard, but not on the site. The site is http://www.retro-food.com
Thank you!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.