• 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 Same After Single Post Entry Widget To Single Pages

Mosts StudioPress themes include a after entry widget coded into the child themes functions file.

Generally the widget only displays after single posts.

If you would also like to display exactly the same widget content after single pages, you can modify the code from this:

To this:

The modified code includes a conditional tag with an array for single posts and pages and won’t display on archive pages.

if ( is_singular(array( 'post','page' ) ) )

If you want to create a new widget which displays after all single pages only, grab this code.

Related Code Snippets

  • Add Genesis After Entry Widget Area To Single Pages
  • Adding New Widget Areas In StudioPress Themes

Reader Interactions

Comments

  1. Tumikia says

    February 22, 2016 at 3:28 pm

    Hi Brad,

    I need an additional widget area that works similarly. I need to add an email subscription and style the background color as orange.

    I am using the after widget area for videos and the background is black.

    What elements of the code do I need to change to get a widget area called “email-subscription” that appears after the entry?

    Please advise.

    Log in to Reply
    • Brad Dalton says

      February 22, 2016 at 11:52 pm

      Try this:

      genesis_register_sidebar( array(
      	'id'          => 'email-subscription',
      	'name'        => __( 'E-mail Subscription', 'genesis' ),
      ) );
      
      add_action( 'genesis_entry_footer', 'your_widget', 25 );
      function your_widget() {
      if ( is_singular(array('post','page') ) AND is_active_sidebar('email-subscription') ) {
      genesis_widget_area( 'email-subscription', array(
      'before' => '<div class="email-subscription widget-area">',
      'after'	 => '</div>',
      		) ); 
      
        }
      
      }
      Log in to Reply
      • Tumikia says

        February 23, 2016 at 10:23 am

        Hi Brad,
        Thanks for the help. How do I apply it to pages as well?
        Tumikia

        Log in to Reply
        • Brad Dalton says

          February 23, 2016 at 10:48 am

          Code updated.

          Log in to Reply
          • Tumikia says

            February 24, 2016 at 11:49 am

            Unfortunately, the widget appears within the content and not after the content like the after-entry widget.

          • Brad Dalton says

            February 25, 2016 at 12:14 am

            Try the updated code

          • Tumikia says

            February 25, 2016 at 10:29 am

            Thank you Brad,

            I changed this one line of code as instructed: add_action( ‘genesis_entry_footer’,
            to add_action( ‘genesis_after_entry’,

            It worked perfectly.

  2. Tumikia says

    July 29, 2015 at 3:37 pm

    Thanks Brad. It worked perfectly in The 411 Pro theme.

    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