Advertisement
daymobrew

THBusiness - change widget tags

Dec 23rd, 2014
1,770
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.74 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * Unregister the original sidebars (with h1 title tags) and reregister (with default h2 title tags).
  5.  *
  6.  */
  7. function thb_reinitialize_sidebars() {
  8.  
  9.     unregister_sidebar( 'thbusiness-main-sidebar' );
  10.     unregister_sidebar( 'thbusiness-business-top-sidebar' );
  11.     unregister_sidebar( 'thbusiness-business-left-sidebar' );
  12.     unregister_sidebar( 'thbusiness-business-right-sidebar' ); 
  13.     unregister_sidebar( 'thbusiness-business-bottom-sidebar' );            
  14.     unregister_sidebar( 'footer-left' );   
  15.     unregister_sidebar( 'footer-mid' );
  16.     unregister_sidebar( 'footer-right' );          
  17.  
  18.     register_sidebar( array(
  19.         'name'          => __( 'Main Sidebar', 'thbusiness' ),
  20.         'id'            => 'thbusiness-main-sidebar',
  21.         'description'   => '',
  22.         'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  23.         'after_widget'  => '</aside>',
  24.         'before_title'  => '<h2 class="widget-title">',
  25.         'after_title'   => '</h2>',
  26.     ) );
  27.     register_sidebar( array(
  28.         'name'          => __( 'Business Template Top Area', 'thbusiness' ),
  29.         'id'            => 'thbusiness-business-top-sidebar',
  30.         'description'   => 'Shows the widgets on the top area of the business page.',
  31.         'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  32.         'after_widget'  => '</aside>',
  33.         'before_title'  => '<h2 class="business-page-widget-title">',
  34.         'after_title'   => '</h2>',
  35.     ) );
  36.     register_sidebar( array(
  37.         'name'          => __( 'Business Template Left Area', 'thbusiness' ),
  38.         'id'            => 'thbusiness-business-left-sidebar',
  39.         'description'   => 'Shows the widgets on the left area of the business page.',
  40.         'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  41.         'after_widget'  => '</aside>',
  42.         'before_title'  => '<h2 class="business-page-widget-title">',
  43.         'after_title'   => '</h2>',
  44.     ) );
  45.     register_sidebar( array(
  46.         'name'          => __( 'Business Template Right Area', 'thbusiness' ),
  47.         'id'            => 'thbusiness-business-right-sidebar',
  48.         'description'   => 'Shows the widgets on the right area of the business page.',
  49.         'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  50.         'after_widget'  => '</aside>',
  51.         'before_title'  => '<h2 class="business-page-widget-title">',
  52.         'after_title'   => '</h2>',
  53.     ) );   
  54.     register_sidebar( array(
  55.         'name'          => __( 'Business Template Bottom Area', 'thbusiness' ),
  56.         'id'            => 'thbusiness-business-bottom-sidebar',
  57.         'description'   => 'Shows the widgets on the bottom area of the business page.',
  58.         'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  59.         'after_widget'  => '</aside>',
  60.         'before_title'  => '<h2 class="business-page-widget-title">',
  61.         'after_title'   => '</h2>',
  62.     ) );               
  63.     register_sidebar( array(
  64.         'name'          => __( 'Footer Left Sidebar', 'thbusiness' ),
  65.         'id'            => 'footer-left',
  66.         'description'   => '',
  67.         'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  68.         'after_widget'  => '</aside>',
  69.         'before_title'  => '<h2 class="footer-widget-title">',
  70.         'after_title'   => '</h2>',
  71.     ) );   
  72.     register_sidebar( array(
  73.         'name'          => __( 'Footer Mid Sidebar', 'thbusiness' ),
  74.         'id'            => 'footer-mid',
  75.         'description'   => '',
  76.         'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  77.         'after_widget'  => '</aside>',
  78.         'before_title'  => '<h2 class="footer-widget-title">',
  79.         'after_title'   => '</h2>',
  80.     ) );   
  81.     register_sidebar( array(
  82.         'name'          => __( 'Footer Right Sidebar', 'thbusiness' ),
  83.         'id'            => 'footer-right',
  84.         'description'   => '',
  85.         'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  86.         'after_widget'  => '</aside>',
  87.         'before_title'  => '<h2 class="footer-widget-title">',
  88.         'after_title'   => '</h2>',
  89.     ) );           
  90. }
  91. add_action( 'widgets_init', 'thb_reinitialize_sidebars', 20 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement