Facebook  Twitter  Google +  Linkedin


Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/lwegabab/public_html/old/plugins/content/al_facebook_comments/al_facebook_comments.php on line 516

Warning: file_get_contents(https://api.facebook.com/restserver.php?method=links.getStats&urls=https://old.yourictmagazine.com/howtos/866-how-to-create-new-custom-widget-positions-in-wordpress-using-functions-php-file-2): Failed to open stream: no suitable wrapper could be found in /home/lwegabab/public_html/old/plugins/content/al_facebook_comments/al_facebook_comments.php on line 516

Warning: Undefined array key 1 in /home/lwegabab/public_html/old/plugins/content/al_facebook_comments/al_facebook_comments.php on line 521

How to create new custom widget positions in WordPress using “functions.php” file.

We well know that most of the templates in WordPress give us limited widget positions, as a developer one could really do a lot if the widget positions in WordPress were not that restricted. Most WordPress templates come with the Main sidebar and a few sidebars. Today I will show you how you create your own widget positions in a much faster an easier way.

 

For the purpose of this tutorial we will create a widget position called “New positions”. Let’s dive in . . .


Step One
In your template files, locate the functions.php file and open it with your favourite text-editor, I recommend using Vscode.

Step Two
Once the functions.php file is open you can now locate the function genesis_register_sidebars() Its in this function that we will create the widget position.

Custom Widget in Wordpress

Step Three
To create the “new positions” widget position use the following code and then save.

Custom Widget in Wordpress

Step Four
Once you have saved the code, you can now refresh the widgets page in WordPress dashboard and the widget position will now be displayed.

How to create new custom widget positions in WordPress using “functions.php” file.

By Martin