December 2017
Beginner
458 pages
7h 52m
English
Let's now register the widgets. We will only have the sidebar in this particular template. Add a function, custom_register_widgets, and call register_widget as shown here:
// Register Widgetsfunction custom_register_widgets(){ register_widget('');}
Here, we will use the categories widget, but we will create a custom version of it and put it in our template in our themes folder. So in the register_widget parentheses, we'll add WP_Widget_Categories_Custom as shown here:
// Register Widgets function custom_register_widgets(){ register_widget('WP_Widget_Categories_Custom')};}
Then we will add the action using add_action, pass in widgets_init as we want this to run, and then add the custom_register_widgets function as shown ...
Read now
Unlock full access