• 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

I want to add a "widget" in my No Sidebar post/page

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 › General Discussion › I want to add a "widget" in my No Sidebar post/page

This topic is: not resolved

Tagged: innovative theme, Newsletter, newsletter on about page

  • This topic has 21 replies, 3 voices, and was last updated 12 years, 11 months ago by Brad Dalton.
Viewing 20 posts - 1 through 20 (of 22 total)
1 2 →
  • Author
    Posts
  • June 6, 2013 at 9:22 am #44320
    lwoods
    Participant

    I want to add a piece of code into my form (or page) content area.  For example, I have a "No Sidebar" page that is an "About Us" but I would like to drop a "Sign up for our Newsletter" box into the content area; maybe on the right, for example.  But I want the content to flow around the box.  In other words it would be the same as having an image in my content but it's a piece of code instead.

    How?

    Thanks

    June 6, 2013 at 9:26 am #44322
    Brad Dalton
    Participant

    Link to that page please.


    Tutorials for StudioPress Themes.

    June 6, 2013 at 9:28 am #44326
    lwoods
    Participant

    Sorry, but I don't understand your message.  Link to what page?

    June 6, 2013 at 10:03 am #44337
    Brad Dalton
    Participant

    Your About Us” page please.

    I'd like to take a look.


    Tutorials for StudioPress Themes.

    June 6, 2013 at 10:04 am #44338
    lwoods
    Participant

    Hi,

    Sorry but I haven't built it yet.  Just want to know how to do it.  I think that answer is to find a plugin with a shortcode that I can drop into my content area.

    June 6, 2013 at 10:26 am #44345
    Brad Dalton
    Participant

    No worries.

    Post this when you have got the site up and i'll give you the solution.


    Tutorials for StudioPress Themes.

    July 20, 2013 at 10:15 pm #51670
    Chrissy Marquardt
    Member

    Hey Brad, you've helped me out before and Im working on a new project and had the same question. Using the Innov8tive theme for my blog and I was able to figure out how to get my newsletter box to appear below posts but I want it to appear below my About page. I know its some code I have to put in the php file but just not sure what it is

    http://www.cleaneatingsimplified.com/about/

    Thanks


    WebSpyred Media: WordPress Websites & Genesis Themes| Follow Me on Twitter | Like Me on Facebook

    July 21, 2013 at 11:42 am #51711
    Brad Dalton
    Participant

    What great timing. I just wrote about this for another community member.

    http://www.studiopress.community/topic/modern-portfolio-about-widget/#post-51709


    Tutorials for StudioPress Themes.

    July 22, 2013 at 2:20 pm #51905
    Chrissy Marquardt
    Member

    Hey Brad,

    I read the other post and I had some follow up questions. Here is the code I have at the bottom of my themes php file that I grabbed based on a tutorial Brian Gardener posted on the eNews extended plugin

    //* Add the newsletter widget after the post content
    add_action( 'genesis_after_post_content', 'custom_add_newsletter_box' );
    function custom_add_newsletter_box() {
    	if ( is_singular( 'post' ) )
    	genesis_widget_area( 'newsletter', array(
    		'before' => '<div id="newsletter">',
    	) );
    }

    So I want to add my newsletter sign up box after my about page and my contact me page ( possibly some other pages in the future but we'll start there for now). What code would I put in the php file ?

    Thanks again !


    WebSpyred Media: WordPress Websites & Genesis Themes| Follow Me on Twitter | Like Me on Facebook

    July 22, 2013 at 4:44 pm #51936
    Brad Dalton
    Participant

    Change the line for the conditional tag to an array:

    if ( is_singular( 'post' ) )
    

    To this:

    if (is_page( array( 'about-me', 'contact-me' ) ) )
    

    Use the page slug or page i.d's

    If it doesn't work, try removing the single quotes and use the page i.d.

    if ( is_page( array( 007, 1180 )  )  )
    

    Tutorials for StudioPress Themes.

    July 24, 2013 at 9:00 pm #52399
    Chrissy Marquardt
    Member

    Hey again

    Thanks for your help with this. I would like to keep my subscription box below my posts AND have it below the contact me and about page. So would it look like this:

    //* Add the newsletter widget after the post content
    add_action( 'genesis_after_post_content', 'custom_add_newsletter_box' );
    function custom_add_newsletter_box() {
    if ( is_singular( 'post' ) )
    if (is_page( array( 'about', 'contact-me' ) ) )
    genesis_widget_area( 'newsletter', array(
    'before' => '<div id="newsletter">',
    ) );
    }
    `
    Thanks again. Really appreciate your input


    WebSpyred Media: WordPress Websites & Genesis Themes| Follow Me on Twitter | Like Me on Facebook

    July 25, 2013 at 12:55 am #52421
    Brad Dalton
    Participant

    You could also use this code:

    https://gist.github.com/braddalton/6077458


    Tutorials for StudioPress Themes.

    July 25, 2013 at 3:24 pm #52495
    lwoods
    Participant

    Brad:

    In the previous reply is "dynamic_sidebar()" a method in a plug-in?

    Thanks

    July 25, 2013 at 3:32 pm #52498
    Brad Dalton
    Participant

    This Conditional Tag checks if the current sidebar has active widgets.

    Source http://codex.wordpress.org/Function_Reference/is_dynamic_sidebar


    Tutorials for StudioPress Themes.

    July 25, 2013 at 4:16 pm #52511
    lwoods
    Participant

    Thanks for the info, Brad. I was just trying to figure out what the call to dynamic_sidebar did. In your example it doesn't look like it's doing anything---or am I missing something. The codex doc says that it returns true/false.

    July 25, 2013 at 4:21 pm #52515
    Brad Dalton
    Participant

    If its a single post or one of 2 pages, it outputs the content of sidebar widget named newsletter. Without the dynamic_sidebar() function, the widget would not work so its essential.


    Tutorials for StudioPress Themes.

    July 25, 2013 at 4:28 pm #52516
    lwoods
    Participant

    Got it. Thanks.

    July 25, 2013 at 10:56 pm #52561
    Chrissy Marquardt
    Member

    Just to clarify ( I just want to make sure I dont screw up my php file so sorry for the questions

    
    add_action( 'genesis_after_post_content', 'custom_add_newsletter_box' );
    function custom_add_newsletter_box() {
    	if ( is_singular( 'post' ) || is_page( array( 'about-me', 'contact-me' ) ) )
    	genesis_widget_area( 'newsletter', array(
    		'before' => '<div id="newsletter">',
    	) );
    }
     
    genesis_register_sidebar( array(
    'id' => 'newsletter',
    'name' => __( 'Newsletter', 'wpsitesdotnet' ),
    'description' => __( 'Newsletter widget.', 'wpsitesdotnet' )
    ) );
    /**
    * @author Brad Dalton - WP Sites
    * @example add_action( 'genesis_after_post_content', 'custom_add_newsletter_box' );
    function custom_add_newsletter_box() {
    	if ( is_singular( 'post' ) || is_page( array( 'about-me', 'contact-me' ) ) )
    	genesis_widget_area( 'newsletter', array(
    		'before' => '<div id="newsletter">',
    	) );
    }
     
    
    

    instead of wpsitesdotnet - I replace this with my site cleaneatingsimplifieddotcom ?
    instead of @author Brad Dalton - @author Chrissy Marquardt - Clean Eating Simplified
    instead of @example http://wp.me/p1Tu0-9Jr - @link http://cleaneatingsimplified.com/about/

    @link
    http://cleaneatingsimplified.com/contact-me

    Here is where I am unclear. I am not sure what I am supposed to be putting here ? What do I replace this with - is it the link to my about page and my contact page ? Do I leave it as @example ? Do I put it twice ?

    Thanks !


    WebSpyred Media: WordPress Websites & Genesis Themes| Follow Me on Twitter | Like Me on Facebook

    July 26, 2013 at 7:05 pm #52707
    Brad Dalton
    Participant

    Try this:

    https://gist.github.com/braddalton/6093219


    Tutorials for StudioPress Themes.

    July 27, 2013 at 12:39 am #52736
    Brad Dalton
    Participant

    You can replace the about' and contact-me words with the page i'd's for those 2 pages which you can grab from the body class in the source code. Simply right click each page and view source code to find it.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 20 posts - 1 through 20 (of 22 total)
1 2 →
  • The forum ‘General Discussion’ 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