Leave a suggestion

If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

How to add widget area

This tutorial will show you how to create new widget area in WordPress. Any widget in WordPress template could be displayed in any place on the page. This could be done using WordPress widget areas.

 

To add widget area access to your WordPress installation folder.

1. Open ‘wp-content/themes/theme###’ folder.

2. View the functions.php file

3. Use search tool (CTRL+F) and search for ‘widget’. You can fund the following lines:

Here you can see that widgets are defined in the sidebar-init.php file

	//Widget and Sidebar
	require_once $includes_path . 'sidebar-init.php';

This line defines the $includes_path variable value.

	$includes_path = TEMPLATEPATH . '/includes/';

These lines shows you that the widgets are defined in the wp-content/themes/theme###/includes/sidebar-init.php file

4. Open sidebar-init.php file. All widget areas are defined here. The following code is used to define wach area:

		register_sidebar(array(
			'name' 			=> 'Sidebar 2',
			'id'			=> 'sidebar-2',
			'description'	=> __( 'Located at the right side of pages.'),
			'before_widget'	=> '<div id="%1$s" class="widget %2$s">',
			'after_widget'	=> '</div>',
			'before_title'	=> '<h3 class="widget-title">',
			'after_title'	=> '</h3>',
	));

To register new widget area copy the code above and paste it before the closing ‘}’ bracket

Change the ‘name’, ‘id’ and ‘description’ values.

 

5. Now you can insert the widget area to any part of the template. Go back to the ‘wp-content/themes/theme###‘ folder. You can insert the area to any layout file:

  • header.php
  • footer.php
  • single.php
  • category.php
  • index.php
  • sidebar.php etc

6. Paste the following code to the required place to insert the widget area.

	<?php if ( ! dynamic_sidebar( 'New Widget Area' ) ) :?><?php endif;?>

Replace ‘New Widget Area’ with your widget area name.

7. If everything has been done correctly the new widget area would be available from the WordPress admin panel Appearance>Widgets (right column) .

 

Feel free to check the detailed video tutorial below:
How to add widget area in WordPress

How to add widget area, 3.3 out of 5 based on 2 ratings
  • Carl

    I’m having problems placing video’s in the Media Player Widget? All options in the library don’t work and can’t be seen?

    • Anonymous

      Please contact our team using the ticket system, send them your order details and template number. Our techs will provide you with specific assistance