Add Custom Widget Area
Registers a new widget area
PHP
function custom_widget_area() {
register_sidebar(array(
'name' => 'Custom Sidebar',
'id' => 'custom-sidebar',
'description' => 'This is a custom widget area',
'before_widget' => '<div class="widget-item">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
));
}
add_action('widgets_init', 'custom_widget_area');
Snippet Feedback
Did this snippet work for you? Do you have any questions about this snippet? Leave some feedback below.
SHARED BY
1 Views