• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Add widget after page in Whitespace theme

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Add widget after page in Whitespace theme

This topic is: not resolved

Tagged: after page, whitespace, widget area

  • This topic has 4 replies, 2 voices, and was last updated 11 years, 6 months ago by Frank.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • April 2, 2015 at 12:17 pm #146480
    Frank
    Member

    Hello,

    I want to add a widget in my pages, but the theme only allows to use the "After Post" widget.

    Here in the forums I found this code that does work in other themes, but for some reason it doesn't in Whitespace:

    //* Relocate after entry widget
    remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
    add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 5 );
    function news_after_entry() {
    
    	if ( is_singular(array( 'post','page' ) ) )
    		genesis_widget_area( 'after-entry', array(
    			'before' => '<div class="after-entry" class="widget-area">',
    			'after'  => '</div>',
    		) );
    
    }
    

    Can you help me to add an after_entry widget in my pages?

    April 2, 2015 at 2:18 pm #146496
    Christoph
    Member

    Hi,

    the after entry widget is already available in Whitespace pro.
    Adding it again won´t work.

    Also the function in your code snippet is not being added in any add_action.

    If you want to add new widget area you will find the code here.
    http://my.studiopress.com/tutorials/register-widget-area/


    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    April 15, 2015 at 5:15 am #147974
    Frank
    Member

    Hi Christoph, thanks a lot for your reply. I couldn't get back to this before.

    I've followed the page you suggest and even though the new widget does appear in the dashboard, actual pages do not show any content. This is the code I have so far:

    //* Register widget area
    genesis_register_sidebar( array(
    	'id'            => 'after-page',
    	'name'          => __( 'After Page', 'themename' ),
    	'description'   => __( 'This the After Page widget area', 'themename' ),
    ) );
    
    //* Hook after post widget area after page content
    add_action( 'genesis_entry_footer', 'sp_after_page_widget' );
    	function sp_after_page_widget() {
    	if ( is_singular( 'page' ) )
    		genesis_widget_area( 'after-post', array(
    			'before' => '<div class="after-post widget-area">',
    			'after' => '</div>',
    	) );
    }

    Does that look right? I'm trying to have a widget specific for pages but it is not working.

    Does that have anything to do with this code I have in my functions file?

    //* Add support for after entry widget
    add_theme_support( 'genesis-after-entry-widget-area' );
    
    //* Relocate after entry widget
    remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
    add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 5 );

    Also, posts have the after page widget working just fine.

    April 15, 2015 at 8:34 am #148000
    Christoph
    Member

    Hi Frank,

    just to clarify, do you want different content in the after_entry/after_page widget for post and pages or is it going to be the same content?

    If it is the same content, your first snippet should work if you change the add_action to include the name of the function.

    You had written in your first post:

    remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
    add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 5 );
    function news_after_entry() {

    Change that to

    remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
    add_action( 'genesis_after_entry', 'news_after_entry', 5 );
    function news_after_entry() {

    The code of your second post looks good.
    Remember that it will only show the widget on single pages, like Contact or About, and not on archive pages.

    Let me know how that works. If it doesn't I´ll take a closer look at your code.

    You can also reference these two pages:

    Add Same After Single Post Entry Widget To Single Pages

    Add New Widget After Single Pages Only


    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    April 15, 2015 at 10:55 am #148024
    Frank
    Member

    Thanks again Christoph, the second link is exactly what I was looking for.

    Cheers 🙂

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble