Register Custom Sidebar in WordPress

Customsidebar

If you are new in WordPress and don’t know how to register the custom sidebar and how to get the custom sidebar value on any page then simply follow the tutorial steps and you can get your custom sidebar.

Step 1)

Copy the below code in your functions.php for register a new custom sidebar.

register_sidebar( array(
‘id’ => ‘ID of your sidebar without space and special character’,
‘name’ => ‘Name of your sidebar without space and special character’,
‘description’ => __( ‘Enter Placeholder Text Here’, ‘text_domain’ ),
) );

Step 2)

Now, You can view the sidebar in you wp-admin widget section.

Step 3)

If you need to get that new custom sidebar value in the wordpress pages then copy the below code with starting and ending of php code in your pages.

dynamic_sidebar( ‘Your custom register sidebar id’ );

Step 4)

Now if you put any widget inside the custom sidebar it will display the widget where you put the code which is define in the step 3.

Leave a Reply

Your email address will not be published.

  +  18  =  25