Advertisement
srikat

Untitled

Jun 1st, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. // Register single-optin widget area
  2. genesis_register_widget_area(
  3. array(
  4. 'id' => 'single-optin',
  5. 'name' => __( 'Single Optin', 'my-theme-text-domain' ),
  6. 'description' => __( 'For email option subscription widget', 'my-theme-text-domain' ),
  7. )
  8. );
  9.  
  10. // Display single-optin widget area on single blog posts other than those categorized under "category-2"
  11. add_action( 'genesis_after_header', 'sk_single_optin' );
  12. function sk_single_optin() {
  13.  
  14. if ( !is_singular( 'post' ) ) {
  15. return;
  16. }
  17.  
  18. if ( !in_category( 'category-2' ) ) {
  19. return;
  20. }
  21.  
  22. genesis_widget_area( 'single-optin', array(
  23. 'before' => '<div class="single-optin widget-area"><div class="wrap">',
  24. 'after' => '</div></div>',
  25. ) );
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement