Widgetizing application layouts

As mentioned earlier, we have the option of creating template files inside a theme or a plugin. Here, we are going to create the templates inside the plugins folder to improve flexibility. So, let's begin the process by creating another plugin named WPWA Theme Manager. Create a folder named wpwa-theme and define the main plugin file as class-wpwa-theme.php with the usual plugin definitions. Next, we can update the constructor code as follows to register the widgetized area for the home page:

class WPWA_Theme { public function __construct() { $this-> register_widget_areas(); } public function register_widget_areas() { register_sidebar(array('name' => __('Home Widgets','wpwa'),'id' => 'home-widgets','description' => ...

Get WordPress Web Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.