• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Add After Post Widget Area In Genesis

There’s at least 3 different ways to display content after your post.

1. You could install the Simple Hooks plugin and simply paste in some html or opt in form code to be displayed after all your posts content.

The only problem is it would also be displayed on your archive pages as well. Unless you add a conditional statement so its only displayed on your single posts.

Here’s the code for displaying HTML after single posts:

Paste this code into the box to be executed using the genesis_after_post_content Hook.

Simple Hooks

Make sure you check the box to Execute PHP on the hook.

This method works well for displaying HTML however does not create a widget area for use with the Genesis eNews extended widget.

Creating Widget Area After Post

2. Another way to add a widget area after your post content is to:

  • Register your widget genesis_register_sidebar
  • Hook it in to the location you want to add your widget content using a php action hook genesis_after_post_content & custom function wpsites_after_post_widget
  • And style your widget area using CSS code .after-post-widget
Note: This code has been taken from another Genesis child theme & modified. Paste it in your child themes functions.php file.

Register & Hook Widget After Single Posts

This code registers the new widget area which you can use to display content after all single posts.

The Enews Extended plugin enables you to connect to MailChimp, Aweber, Feedblitz and Feedburner.

Genesis Built in After Post Widget

3. Genesis now includes a built in function which enables you to add 1 line of PHP code to the end of your child themes functions file to display the after entry widget area. This is the easiest and most efficient way to add a new widget after single posts.

add_theme_support( 'genesis-after-entry-widget-area' );

Styling

You’ll need to add some styling which will be theme specific.

Here’s some CSS you can customize to match your own themes styling.

.after-post-widget {
background-color: #f5f5f5;
margin: 5px 0 10px;
padding: 10px;
overflow: hidden;
}

Change Width

You can also change the width of the entry field as well as the font size of the text inside the email box.

Editing this code will effect your eNews Widget on a site wide basis.

.enews #subbox {
    -moz-box-sizing: border-box;
    background-color: #fff;
    box-sizing: border-box;
    color: #888;
    font-size: 16px;
    margin: 0 0 10px;
    padding: 15px;
    text-transform: uppercase;
    width: 65%;
}

You can use either a percentage or pixel value for the width.

Using Different Code

There’s different PHP code you can use to create after post widgets in Genesis.

Not all StudioPress child themes use the same code, so you may want to try different snippets to find out which one works best in your child theme.

Reader Interactions

Comments

  1. Ryan Hanley says

    March 17, 2014 at 8:23 pm

    Brad,

    Any reason this wouldn’t work on Parallax Pro?

    I’m usually pretty good at this stuff and for the life of me I can’t get the inline to work on Parallax. I know the built in after post widget is marked .after-entry and I made that change. Everything else should work the same right?

    All I get no matter what is Full-width input and button.

    it’s driving me nutz!!!

    Ryan

    Log in to Reply
    • Brad Dalton says

      March 17, 2014 at 8:55 pm

      You mean 3 widgets inline?

      Log in to Reply
  2. Zimbrul says

    January 15, 2014 at 1:03 pm

    How do you add a “before entry” widget to Magazine Pro theme? Looking to the hook reference guide I cannot figure out what hook to use…

    Log in to Reply
    • Brad Dalton says

      January 15, 2014 at 11:42 pm

      You can use genesis_before_entry or any other hook http://genesistutorials.com/visual-hook-guide/

      Log in to Reply
  3. Ross says

    May 17, 2013 at 4:13 pm

    Hello Brad,

    Wondering if you can help… I want to add a sentence above a section of my homepage, and I want a little spacing below the sentence.

    I used the following code but the style for padding is being ignored.

    sentence here

    I have also tried to enclose the sentence in tags, as well as simply adding a couple tags after the sentence. No matter what I try, there is no way to add a little space after the sentence.

    I am using the latest versions of Genesis and Genesis Hooks.

    The hook I am working with is: genesis_before_content_sidebar_wrap

    Do you happen to know why any attempt to create space/padding is being ignored?

    Thanks, Ross.

    Log in to Reply
    • Brad Dalton says

      May 17, 2013 at 9:22 pm

      Does the code include a div class and i.d?

      Better to use a custom function that generates a new class for styling and adding padding than using Simple Hooks.

      The code you pasted into Simple Hooks doesn’t include a class which you can use to style your text and apply the padding-bottom property to.

      Log in to Reply
    • Brad Dalton says

      May 17, 2013 at 11:38 pm

      Hi Ross

      Try the CSS code in this tutorial http://wpsites.net/web-design/3-ways-to-add-text-before-content-on-your-home-page/

      Log in to Reply
  4. Jenny says

    May 17, 2013 at 3:08 pm

    I use genesis & i copied/pasted the code into my file but got a php error with the “register_sidebar” line.

    Log in to Reply
    • Brad Dalton says

      May 17, 2013 at 8:13 pm

      Hi Jenny.

      Which code? There’s 4 snippets there and they’re all tested so they work.

      Did you copy the code using the view raw link?

      Did you use a text editor like Notepad++?

      All code works but the apostrophes can change if you don’t copy and paste correctly causing errors.

      Did you paste the code into your WordPress theme editor or the functions.php file?

      I think you must have copied the code for Simple Hooks and pasted it into your functions.php file which doesn’t include code for regsitering the sidebar as its simply echoing the text.

      Use the 2nd snippet in your functions.php file please.

      Here’s a new post i published today with 3 PHP code snippets and some sample CSS included as well that should help,

      Log in to Reply
  5. Larry James says

    December 2, 2012 at 7:48 pm

    Here it is on PasteBin
    http://pastebin.com/raw.php?i=4Yc9ha6e

    Log in to Reply
    • Brad Dalton says

      December 2, 2012 at 7:50 pm

      Thanks Larry. That’s good for HTML code and a lot faster than adding a widget.

      Your Html Goes Here

      Log in to Reply
    • Brad Dalton says

      December 3, 2012 at 7:42 am

      Hey Larry. Would you like a write a guest post on WP Sites??

      Log in to Reply
      • Larry James says

        December 5, 2012 at 12:29 am

        Thank you for asking me to write a guest post on your blog Brad. I would be happy too. It will have to wait until after Christmas though. I will be in touch with you after the holidays.

        Thanks again for asking 🙂

        Log in to Reply
  6. Larry James says

    December 2, 2012 at 7:04 pm

    I use the Genesis Simple Hooks plugin, and I just add a conditional statement. It works great for me. I use the example below and output shows on my posts, not on the archive pages.

    My HTML goes in here

    Just make to check the box that says “Execute PHP on this hook?”

    Log in to Reply
    • Brad Dalton says

      December 2, 2012 at 7:10 pm

      Hi Larry. Can i see the code you use in Simple Hooks?

      Log in to Reply
      • Larry James says

        December 2, 2012 at 7:28 pm

        I thought I put it in there, he it is again. I have pasted it below.

        Html Code Goes Here

        Log in to Reply
        • Brad Dalton says

          December 2, 2012 at 7:44 pm

          How about Pastebin and paste the link here.

          Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.