phpwordpressgenesis

Adding widget within content


On my Wordpress site using the Genesis framework and magazine pro theme I'm trying to add a widget at the top of the homepage within the content so it's not above the sidebar. I've tried the following:

add_action( 'genesis_before_content', 'before_home_top' );

gives

<div class="content-sidebar-wrap">
<div class="before-home-top">
</div>
<main class="content">
</main>
<aside class="sidebar">
</aside>
</div>

Which doesn't work because it goes above both the content AND the sidebar pushing the sidebar down.

add_action( 'genesis_after_content', 'before_home_top' );

gives

<div class="content-sidebar-wrap">
<main class="content">
</main>
<aside class="sidebar">
</aside>
<div class="before-home-top">
</div>
</div>

Basically from this image I want the second widget area and not the first full width widget area. https://i.sstatic.net/pGDUb.jpg


Solution

  • I don't have access to the Genesis codebase to give you a direct answer, but according to this page you have some actions available.

    From that page:

    Give those a try!