How to Reposition the After Entry Widget Area with Genesis

How to Use genesis_after_entry_widget_area to

Reposition the After Entry Widget Area with Genesis

The after entry widget area is an optional widget area for Genesis themes, which displays after your blog entries. You can use it for a newsletter signup form, a list of related posts or advertisements.

By default, the after entry widget area outputs after the close of the <article class="entry"> (HTML5) markup element and after the author box (if you have selected to display an author box).

However, Genesis makes it easy to reposition the after entry widget area to better suit your design. For example, the Genesis theme below (Parallax Pro) moves the after entry widget area before the author box:

This is a special widget area which is displayed after your blog entries. You can use this for a newsletter signup form, a list of related posts or advertisements.
This Genesis theme (Parallax Pro) moves the after entry widget area above the author box

Function

The function responsible for outputting the after entry widget area is genesis_after_entry_widget_area.

This function first checks that a singular Post is being displayed and that your theme has declared support for the after entry widget area. If both conditions pass, it outputs the widget area wrapped in a <div class="after-entry widget-area"> markup element.

By default, genesis_after_entry_widget_area is hooked to genesis_after_entry.

Reposition the After Entry Widget Area

To reposition the after entry widget area, unhook genesis_after_entry_widget_area from genesis_after_entry, and then re-hook it on a different hook and/or a different priority.

The code you’ll need to install is below. Just replace another_hook with your desired hook. You can optionally include a third argument to control the priority.

 

Remove the After Entry Widget Area

To remove the after entry widget area altogether, you can just remove theme support. However, if you’d like to show it under certain circumstances and withhold it under others, it might be more appropriate to unhook genesis_after_entry_widget_area as shown above but in conjunction with the template hierarchy.

Enable the After Entry Widget Area for XHTML

Because genesis_after_entry is an HTML5 hook, enabling theme support for the after entry widget area will not work for the older XHTML Genesis themes.

If you’re running on an XHTML Genesis theme, you can enable the after entry widget area by first enabling theme support and then hooking genesis_after_entry_widget_area to an XHTML hook. The suggested one is genesis_after_post.

Change Log

The function genesis_after_entry_widget_area has been included since version 2.1.0.

Source File

The function genesis_after_entry_widget_area is located in lib/structure/post.php.

a2z Entry

Add a Comment

Your email address will not be published. Required fields are marked *