• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Extra sidebar area pushes content down

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved

Tagged: content, extra sidebars, sidebars

  • This topic has 6 replies, 2 voices, and was last updated 9 years, 12 months ago by Elaine Griffin.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • April 1, 2013 at 12:47 pm #32486
    Elaine Griffin
    Member

    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 #32524
    Brian Bourn
    Member

    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:

    add_action( 'genesis_before_sidebar_widget_area', 'your_function_name' );

    Bourn Creative | bourncreative.com | Twitter

    April 2, 2013 at 7:51 am #32630
    Elaine Griffin
    Member

    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!

     

    April 2, 2013 at 8:55 pm #32772
    Brian Bourn
    Member

    This 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 #32774
    Brian Bourn
    Member

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


    Bourn Creative | bourncreative.com | Twitter

    April 3, 2013 at 9:42 am #32837
    Elaine Griffin
    Member

    Hmmm, that gave me the white screen of death.

    April 5, 2013 at 11:55 am #33338
    Elaine Griffin
    Member

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

    I have this in the before_sidebar hook:

    &lt;div class=”before-sidebar-ads”&gt;
    &lt;?php dynamic_sidebar( ‘before-sidebar-ads’ ); ?&gt;
    &lt;/div&gt;
    

    Here is what I have in my functions file:

    /**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;’;
    }
    

    I see the sidebar in my dashboard, but not on the site. The site is http://www.retro-food.com

    Thank you!

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble