Extra sidebar area pushes content down

Community Forums Forums Design Tips and Tricks Extra sidebar area pushes content down

This topic is: not resolved

This topic contains 6 replies, has 2 voices, and was last updated by  Elaine Griffin 1 year, 6 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #32486

    Elaine Griffin
    Participant
    Post count: 86

    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

    #32524

    Brian Bourn
    Participant
    Post count: 98

    Looks 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:

    [php]add_action( ‘genesis_before_sidebar_widget_area’, ‘your_function_name’ );[/php]


    Bourn Creative | bourncreative.com | Twitter

    #32630

    Elaine Griffin
    Participant
    Post count: 86

    Thanks 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!

     

    #32772

    Brian Bourn
    Participant
    Post count: 98

    This is one way you can do it in your functions file:

    [php]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>’;
    }[/php]


    Bourn Creative | bourncreative.com | Twitter

    #32774

    Brian Bourn
    Participant
    Post count: 98

    You’ll also still need to register the widget like you already have.


    Bourn Creative | bourncreative.com | Twitter

    #32837

    Elaine Griffin
    Participant
    Post count: 86

    Hmmm, that gave me the white screen of death.

    #33338

    Elaine Griffin
    Participant
    Post count: 86

    I’m still stuck on this, if anyone can help at all.

    I have this in the before_sidebar hook:
    [php]
    &lt;div class=”before-sidebar-ads”&gt;
    &lt;?php dynamic_sidebar( ‘before-sidebar-ads’ ); ?&gt;
    &lt;/div&gt;
    [/php]
    Here is what I have in my functions file:
    [php]

    /**add a new sidebar**/
    genesis_register_sidebar( array(
    ‘id’        =&gt; ‘before-sidebar-ads’,
    ‘name’      =&gt; ‘Before Sidebar Ads’,
    ‘description’   =&gt; ‘This is a sidebar that goes before the sidebar.’,
    ) );
    /** Loads a new sidebar before the sidebar */
    function child_before_sidebar() {
    echo ‘&lt;div class="before-sidebar-ads”&gt;’;
    dynamic_sidebar( ‘before-sidebar-ads’ );
    echo ‘&lt;/div&gt;’;
    }
    [/php]
    I see the sidebar in my dashboard, but not on the site. The site is http://www.retro-food.com

    Thank you!

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.