• 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

Call widget area before content in genesis_post_content?

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 › General Discussion › Call widget area before content in genesis_post_content?

This topic is: resolved
  • This topic has 8 replies, 2 voices, and was last updated 13 years, 1 month ago by rfmeier.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • June 5, 2013 at 6:53 pm #44247
    Ben @ Inbound Creative
    Member

    I'm trying to add a widget area to the left of the content in the genesis_post_content hook area.

    I've already set a width for the content and padded it to the right so that the space is free for the widget.

    However, the widget area is being called after the content and so it is appearing at the bottom (see picture below).

    I want the widget area to be called first so that the widgets contained in it will appear in line with the top of the content just 20px below the main image.

    Any idea how to fix this? (Sorry, the site is on a localhost, so no link for the time being).

    I know this is going to be because I'm tired, it being nearly 2am and that I should really be in bed. But this is driving me up the wall and I'm determined to defeat it before going to sleep.


    Award winning web design in Liverpool | UK based Genesis Framework web designer and developer

    June 5, 2013 at 7:10 pm #44250
    rfmeier
    Member

    Hello,

    Since it is local to your development environment, I am gonna have to guess some possible culprits.

    Does the widget area have the appropriate css styling to float? It almost looks like the content has cleared both sides, forcing the widget down.

    Again, it's hard to rule out css rules since I cannot debug the site.

    Let me know.


    Ryan Meier – Twitter

    June 5, 2013 at 7:11 pm #44251
    Ben @ Inbound Creative
    Member

    Just in case it's not 100 per cent obvious what I'm trying to achieve without being able to access the site, I've mocked up a screen in photoshop to demonstrate.

    Want to achieve

    As you can see, the widgets on the left have moved up to be inline with the top of the content under the featured image.

    As I said, any help will be much appreciated.


    Award winning web design in Liverpool | UK based Genesis Framework web designer and developer

    June 5, 2013 at 7:16 pm #44253
    Ben @ Inbound Creative
    Member

    Hi Ryan,

    I might upload it to my hosting tomorrow to make it easier to debug.

    In the meantime, it's not a clearance issue. I'll paste the relevant code below until I've uploaded the site tomorrow.

    From the functions file (for the call):
    `// Inserts advert spotbox into single posts
    add_action( 'genesis_post_content', 'metro_advert_box' );
    function metro_advert_box() {
    if (is_single() && is_active_sidebar( 'in-post' ) ) {
    echo '';
    dynamic_sidebar( 'in-post' );
    echo '';
    }
    }`

    And the CSS:

    `.entry-content p {
    clear: none;
    position: relative;
    font-size: 14px;
    font-size: 0.875rem;
    width: 53%;
    padding-left: 47%;
    right: 0;
    }`

    `.spotbox {
    width: 45%;
    float: left;
    margin: 0 0 15px 0;
    margin: 0 0 1rem 0;
    padding: 0;
    border: none;
    }

    .spotbox img {
    float: left;
    margin: 0 0 15px 0;
    margin: 0 0 1rem 0;
    padding: 0;
    border: none;
    }`


    Award winning web design in Liverpool | UK based Genesis Framework web designer and developer

    June 5, 2013 at 7:32 pm #44255
    rfmeier
    Member

    For giggles, have you tried removing the left padding on the .entry-content p?

    Just throwing ideas out.


    Ryan Meier – Twitter

    June 6, 2013 at 9:27 am #44325
    Ben @ Inbound Creative
    Member

    All that does is constrain the content within the boundaries of the width on the left rather than the right side of the genesis_post_content area like I need it to be.

    I've copied the CSS and functions pages over from the local host and pasted them as is into the same files on the server hosted version.

    This post is the only thing I've uploaded as it's the only thing I've having an issue with at the moment.

    http://www.furfiemedia.co.uk/news/involuntary-it-managers-costing-small-businesses-in-productivity/

    Let me know if you need any other information or code.


    Award winning web design in Liverpool | UK based Genesis Framework web designer and developer

    June 6, 2013 at 9:47 am #44335
    rfmeier
    Member

    Looking at this within chrome helped and I could edit css and move elements around.

    With the widget elements appearing before the entry content your css worked well, From your code you posted before, try this;

    // Inserts advert spotbox into single posts
    add_action( 'genesis_post_content', 'metro_advert_box', 9 );  // set priority less than 10
    function metro_advert_box() {
    	if (is_single() && is_active_sidebar( 'in-post' ) ) {
    		echo '';
    		dynamic_sidebar( 'in-post' );
    		echo '';
    	}
    }

    I set the priority to 9. This will execute your code before the default Genesis callbacks.

    Hope this helps.


    Ryan Meier – Twitter

    June 7, 2013 at 1:42 pm #44626
    Ben @ Inbound Creative
    Member

    Thank Ryan,

    I had a feeling it was going to be a case of setting a priority level.

    Just for reference – in case anyone else is interested – once I put that code into, I needed to create css for each of the div ids.

    I used the information from the .spotbox classes, and simply added clear: both; to each of the new ids.

    That sorted it all out now.

    For example, in the advert box – which is a text widget, the css is now:

    `#text-5 {
    width: 45%;
    clear: both;
    float: left;
    margin: 0 0 15px 0;
    margin: 0 0 1rem 0;
    padding: 0;
    border: none;
    }`


    Award winning web design in Liverpool | UK based Genesis Framework web designer and developer

    June 7, 2013 at 3:41 pm #44649
    rfmeier
    Member

    Good to hear it worked. I am glad I could help.


    Ryan Meier – Twitter

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘General Discussion’ 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

© 2026 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