Learn how to insert the widget area that normally appears after the entries on Genesis Framework pages by code.
It is very common to find Genesis child themes that contain an “after entry” widget.
This is the one after the post content and just before the comments.
It is often used to add a call to action (CTA), such as a form for readers to subscribe to the newsletter.
In general it makes sense to restrict it to posts, but you may want to show it on pages as well.
Is this your case? Then you are about to find out how to do it. 😉
Code to add to pages the widget that goes after posts
Insert this snippet at the end of the functions.php file:
To see this and another 1097 code snippets of this website, login or subscribe here.
Done! Now the widget will be displayed on both pages and entries.
What if you are not using Genesis Sample and your theme does not incorporate this widget area?
No problem, just enter the following snippet in functions.php:
// Add support for the widget area after the post
add_theme_support( 'genesis-after-entry-widget-area' );
Note, however, that in this case you may need to make minor CSS adjustments to ensure that it looks right.
Conclusions
The post-entry widget area in Genesis is very convenient for placing information you want to display at the end of each content.
By default, its display is restricted to posts, but by applying the code snippet above you can get it to appear on your child theme pages as well.
Any questions? Let me know in the comments.
And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉