Add Widget Before Secondary Sidebar

If you’re a web designer, you’ll almost certainly be familiar with hooks especially for creating custom widget area’s.

If you take a look at all the Genesis hooks, you’ll notice there’s several hooks you can choose from for targeting the secondary sidebar.

The secondary or alt sidebar is only activated once you change the layout settings and select the sidebar – content – sidebar layout.

Layout Settings

The hook to use if you want to add a custom widget which displays content before the secondary sidebar is named the genesis_before_sidebar_alt_widget_area hook.

Code

And here’s the code which you can add to the end of your child themes functions.php file ‘as is’ or modify by changing the hook and/or adding a conditional tag to your custom function.

Genesis Core Sidebar Alt File

You’ll find the hooks which apply to the secondary sidebar in the Genesis core files which should Never be modified.

The hooks are in the sidebar-alt.php file and look exactly like this:

Screenshot highlighting the genesis_before_sidebar_alt_widget_area hook

Sidebar Alt Hooks - Secondary sidebar Genesis

Creating custom widgets and displaying them using Genesis hooks makes web design about as easy as it can get at the moment.


Comments

2 responses to “Add Widget Before Secondary Sidebar”

  1. Zach Russell Avatar
    Zach Russell

    Great post Brad. I always love doing tutorials on some useful things done with Genisis Hooks. It seriously changed the way I thought of theme development!

    1. Hey Zach. Yeah they make displaying content anywhere in a theme easy. No need to edit template files anymore.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.