General Functions php

Register a widget area (inside after_setup_theme)

		//register a sidebar
		function register_custom_widget_area() {
				'id' => 'sidebar-1',
				'name' => esc_html__( 'Sidebar', 'theme-domain' ),
				'description' => esc_html__( 'A new widget area made for testing purposes', 'theme-domain' ),
				'before_widget' => '<div id="%1$s" class="widget %2$s">',
				'after_widget' => '</div>',
				'before_title' => '<div class="widget-title-holder"><h3 class="widget-title">',
				'after_title' => '</h3></div>'
		add_action( 'widgets_init', 'register_custom_widget_area' );
		// Add theme support for selective refresh for widgets in customizer.
		add_theme_support( 'customize-selective-refresh-widgets' );

Search the site


Subscribe to get regular news and updates

  • This field is for validation purposes and should be left unchanged.