Skip to content

Instantly share code, notes, and snippets.

@braginteractive
Created April 18, 2017 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braginteractive/47f4efa563984916abd9535536125f69 to your computer and use it in GitHub Desktop.
Save braginteractive/47f4efa563984916abd9535536125f69 to your computer and use it in GitHub Desktop.
Resister the Contact widget area in WordPress theme
<?php
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function helpwp_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'helpwp' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'helpwp' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h4 class="widget-title">',
'after_title' => '</h4>',
) );
register_sidebar( array(
'name' => esc_html__( 'Contact', 'helpwp' ),
'id' => 'contact',
'description' => esc_html__( 'Add widgets here.', 'helpwp' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h4 class="widget-title">',
'after_title' => '</h4>',
) );
}
add_action( 'widgets_init', 'helpwp_widgets_init' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment