Skip links

Join 2,509 other smart freelancers!

Sign up to learn how to keep your skills up to date on the tech that matters most and confidently sell your skills to a growing customer base.
I will never spam you. You can unsubscribe at any time.

Reader Interactions

Comments

  1. Evernoted !

    I was going about why the Brian Gardner tutorial (based on previous Genesis versions) wasn’t working on my Minimum Pro theme.

    I now can place my optin box in every single post.

    Thank you very much, Carrie !

  2. Great explanation Carrie, it shows up in the Widgets panel.

    I used some text to try it and went to a blog post to check it out. It does show after the blog post, but it also shows duplicated above the comments: http://i.imgur.com/h3Rt2Xj.png

    Maybe I did something wrong?

    • Hmm, is that post for a custom post type or just a regular post?

      Change the conditional from is_singular( 'post' ) to is_single( 'post') and see if that does the trick.

      • I changed child theme and it works as intended now, it was probably something I did or the child theme.

        On a different question, can the After Entry display different messages according to category?

        For example, if you wanted to display different content after the post on your Grab Bag and another on Typography category?

        • Hey Jonas,
          Sorry your comment slipped by me. You could do that programatically, but probably easier with a plugin. If you’re running Jetpack, there’s a visibility setting on widgets that you can use to toggle it on/off for categories. If not Jetpack, there are others like the Dynamic Widgets plugin.

          So, with a plugin like that, you’d still follow the tutorial, but you could drag multiple widgets into that widget area and display each one conditionally using a plugin. Make sense?

          Cheers,
          Carrie

          • No worries Carrie, thank you for replying.

            That makes perfect sense.

            I looked at Jetpack but someone mentioned it was bloated so I used Dynamic Widgets instead.

            Here’s what I did, this might be useful to Christina or others.

            I dragged two text widgets into the After Entry widget (created through your tutorial), where each text widget had a different message according to category.

            When you open the text widget to type your text you’ll notice a new option below the “adds paragraphs automatically”. It will say “Dynamic Widgets: Static”. You click on it and look for individual articles and then choose to show the widget on individual articles, and where it should not show up.

            Note that it is “except on these categories”. Save and it brings you back to the widgets pane. See the front-end of the website and you’ll see it display different content according to the category you set.

    • The concept certainly would. I don’t work with Prose often, but if I recall – I think you’d add your customizations to init.php instead of functions.php. Let me know if that works for you.

      • Am getting ready to install and use Prose for first time, so have saved this post – will try this and let you know – but will be later 🙂 – Thank you for your reply.

  3. Thank you so much for this tut! I applied it to my first Genesis child theme that is currently under works, and it worked like a charm! I also took your suggestion at the end of the tut, and applied the code with minor changes and created another one I called “After Loop” widget. I’m glad I found this blog. I love your tips, please continue posting more, as a beginner front-end dev I appreciate a community of devs willing to teach, share and help others like myself. 🙂

  4. Sorry…my above comment didn’t include code snippets. So here it is again for benefit of others.

    For my Education theme I had to remove ‘<div class=”wrap”>’ and the matching ‘</div>’ to contain the widget within the post-width. Otherwise, the widget is spreading across the entire width of the site.

  5. Thank you so much Carrie! I am using this on my website. However, what I would like to achieve is to display related posts on the right side of my widget (left one is for newsletter sign up). I would it if you could point me to how to achieve this. Note: I haven’t got a related post plugin installed nor hard-coded it in the functions.php.

    What I can’t figure out is to tell WP/Genesis to display the related posts at that very location. Anyhow, if you have a minute and an idea it would be greatly appreciated.

    • Heya,
      You could use the Genesis built-in column classes to split that widget area into a left/right part. So, drag a text widget into the After Entry widget area and use something like this:

      <div><!-- put your newsletter signup shortcode or form here --></div>
      <div><!-- put related posts shortcode or whatever here --></div>

      Cheers,
      Carrie

      • Thanks Carrie, that’s what I ended up using but I had to find a way to display the related posts in the columns! My solution is ok but not great. Really appreciate your help!

  6. Hi Carrie,

    After searching and searching in Google I finally found your tutorial and it worked like a charm at the exact position I want it to be :). Just one question. How to do I make it visible on certain post? For example I want to insert a disclaimer on sponsored post but not wanting it to appear on non-sponsored post. So I need to have it on certain post only.

    Thanks in advance!

    • Glad it worked! Simplest approach would be to add a “sponsored” category and make sure all your sponsored post are assigned to that (and assume that any not assigned to that category are non-sponsored).

      From there, use a conditional statement to show it when you want. Here are examples from the codex and an intro post to WordPress conditionals if you’re still getting your feet wet with them.

      Another approach is to still use the categories, but use a plugin like Display Widgets to take care of the conditionals part.

  7. Hi Carrie.

    I was wondering what you would do if you wanted to have multiple widgeted areas after the entry (ie: one for the sign-up form and a second for an ad)? This way, each different section stands on its own and is a bit cleaner aesthetically. Thanks for your time 🙂

  8. Hi, thank you for the great article! Do you know how to make this mobile responsive? I implemented this and add the genesis newsletter widget, however it looks distorted. Thanks!

  9. Hey Carrie,

    Great tutorial! I’m trying to exclude just a handful of pages and posts from displaying the after entry widget, but so far, no dice. Any advice? #phpisnotmyforte

  10. HI, thanks for the great tut. Sorry iam ni developer.
    How to change the script to show on individual pages, not posts?

    Below code is not working ;-(

    /** Add the after post section */
    genesis_register_sidebar( array(
    ‘id’ => ‘afterpost’,
    ‘name’ => __( ‘After Post Widget’, ‘child theme’ ),
    ‘description’ => __( ‘This is the after post section.’, ‘child theme’ ),
    ) );

    /** Add Hook to show widgets after Post Section. */
    add_action( ‘genesis_after_entry’, ‘custom_add_after_post_box’, 1 );
    function custom_add_after_post_box() {
    if ( is_singular( ‘post’ ) )
    genesis_widget_area( ‘afterpost’, array(
    ‘before’ => ”,
    ) );
    }

  11. Carrie, I just want to express my appreciation of your work. You, more than anyone else, has taught me how to code and build my own genesis wordpress site. Seriously…every time I need to figure out how to do something I Google “Carrie Dils + whatever it is I need to do”. You’re awesome.

  12. My theme now already has this widget enabled and has the line below in the functions.php

    //* Add support for after entry widget
    add_theme_support( ‘genesis-after-entry-widget-area’ );

    How could I make this conditional based on category? Would I have to remove it in the child theme, then re-setup as above. Or is there an easier way?

    Many thanks for any pointers… Lins

  13. Still getting the value out of this thing!!

    Just used this post to finally figure out how to populate “pages” with the after entry widget as well.

    thx carrie!

  14. Late to the party, but just sayin’ … nice one Carrie, got it looking nice on our app’s blog 🙂

  15. Hey Carrie:

    Thanks for the tut. Required minor experimentation for a Genesis newbie, which means that this was extremely straightforward.

    I am running it on Magazine Pro and after implementation, the content is the widgetted (neologism!) area is rendered in stack format rather than side-by-side format.

    Is there a quick solution to render content featured here (posts in my case) as around 1/3 of the area? I am going for the same effect of the 3 posts displayed above your comments section above.

    Thanks for your time. 🙂

  16. Hi Carrie,

    I’m late to the party as well, and encountered a problem. I was able to follow the first part successfully, but I also wanted to add the second part with a conditional. In my case, the second widget needs the post to be in the “resorts” category (that’s the slug). So I tried it and nothing happens. Both widgets appear on the Widgets page and both have a text. Only the first one appears in all categories, but the second doesn’t appear even in its category posts.

    This is my code for the 1st and 2nd widgets.

    /* ADD THE AFTER ENTRY WIDGET */

    // Register Widget Areas
    genesis_register_sidebar( array(
    ‘id’ => ‘after-entry’,
    ‘name’ => __( ‘After Entry’, ‘theme-prefix’ ),
    ‘description’ => __( ‘This is the After Entry Section.’, ‘theme-prefix’ ),
    ) );
    // Hooks After Entry Widget Area to Single Posts
    add_action( ‘genesis_entry_footer’, ‘after_entry_widget’ );
    function after_entry_widget() {
    if( ! is_singular( ‘post’ ) )
    return;
    genesis_widget_area( ‘after-entry’, array(
    ‘before’ => ”,
    ‘after’ => ”,
    ) );
    }

    /*———————————————————————————-*/

    /* ADD A SECOND AFTER ENTRY WIDGET, BUT THIS IS CONDITIONAL */
    /* In this case, it only shows up when Post is in the “Resorts” Category */

    // Register Widget Areas
    genesis_register_sidebar( array(
    ‘id’ => ‘after-entry-conditional’,
    ‘name’ => __( ‘After Entry Conditional’, ‘theme-prefix’ ),
    ‘description’ => __( ‘This is the After Entry Conditional Section.’, ‘theme-prefix’ ),
    ) );
    // Hooks After Entry Conditional Widget Area to Posts in “Resorts” category
    add_action( ‘genesis_entry_footer’, ‘after_entry_conditional_widget’ );
    function after_entry_conditional_widget() {
    // Here is the Conditional
    if( ! is_category( ‘resorts’ ) )
    return;
    genesis_widget_area( ‘after-entry-conditional’, array(
    ‘before’ => ”,
    ‘after’ => ”,
    ) );
    }

  17. Hey Carrie,

    For some reason, the ‘before’ and ‘after’ code didn’t paste well, here they are:

    /* ADD THE AFTER ENTRY WIDGET */

    // Register Widget Areas
    genesis_register_sidebar( array(
    ‘id’ => ‘after-entry’,
    ‘name’ => __( ‘After Entry’, ‘theme-prefix’ ),
    ‘description’ => __( ‘This is the After Entry Section.’, ‘theme-prefix’ ),
    ) );
    // Hooks After Entry Widget Area to Single Posts
    add_action( ‘genesis_entry_footer’, ‘after_entry_widget’ );
    function after_entry_widget() {
    if( ! is_singular( ‘post’ ) )
    return;
    genesis_widget_area( ‘after-entry’, array(
    ‘before’ => ”,
    ‘after’ => ”,
    ) );
    }

    /*———————————————————————————-*/

    /* ADD A SECOND AFTER ENTRY WIDGET, BUT THIS IS CONDITIONAL */
    /* In this case, it only shows up when Post is in the “Resorts” Category */

    // Register Widget Areas
    genesis_register_sidebar( array(
    ‘id’ => ‘after-entry-conditional’,
    ‘name’ => __( ‘After Entry Conditional’, ‘theme-prefix’ ),
    ‘description’ => __( ‘This is the After Entry Conditional Section.’, ‘theme-prefix’ ),
    ) );
    // Hooks After Entry Conditional Widget Area to Posts in “Resorts” category
    add_action( ‘genesis_entry_footer’, ‘after_entry_conditional_widget’ );
    function after_entry_conditional_widget() {
    // Here is the Conditional
    if( ! is_category( ‘resorts’ ) )
    return;
    genesis_widget_area( ‘after-entry-conditional’, array(
    ‘before’ => ”,
    ‘after’ => ”,
    ) );
    }

  18. Oh, me again…

    Carrie, I got it to work. I just had to pull off that “!” and tadaaa!…

    Thanks anyway, your posts are amazing and really useful.

  19. Hi Carrie!

    Your tutorial is great and was so easy to follow. I used it to add a related post widget after every post but the images are stacking on top of each other, how do I make them line-up side by side?

Trackbacks

  1. […] If I’m hiring a designer, this gives him a clear indication of what I want where. If I’m choosing a premade Genesis theme, then I know I need one that has styling for a two column layout, styling for an email subscription box, styling for an author bio and I’m going to need one with widget areas under the post content (or be comfortable enough with code to add them myself). […]

Leave a Reply