Skip to content

Instantly share code, notes, and snippets.

@studiopress
Last active August 11, 2016 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save studiopress/5635539 to your computer and use it in GitHub Desktop.
Save studiopress/5635539 to your computer and use it in GitHub Desktop.
Genesis after post widget.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Register after post widget area
genesis_register_sidebar( array(
'id' => 'after-post',
'name' => __( 'After Post', 'themename' ),
'description' => __( 'This is a widget area that can be placed after the post', 'themename' ),
) );
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Hook widget area after post content
genesis_widget_area( 'after-post', array(
'before' => '<div class="after-post widget-area">',
'after' => '</div>',
) );
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Hook after post widget area after post content
add_action( 'genesis_after_post_content', 'sp_after_post_widget' );
function sp_after_post_widget() {
if ( is_singular( 'post' ) )
genesis_widget_area( 'after-post', array(
'before' => '<div class="after-post widget-area">',
'after' => '</div>',
) );
}
@bolorino
Copy link

The register-widget-area-2.php code is incomplete.

@lizatsalk
Copy link

The code in the register-widget-area-2.php needs close parens and semicolon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment