dynamic widget of wordpress code example
Example: dynamic widget of wordpress
/* functions.php file */
function twentyseventeen_widgets_init() {
register_sidebar(
array(
'name' => __( 'Blog Sidebar', 'twentyseventeen' ),
'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'twentyseventeen' ),
'before_widget' => '',
'before_title' => '',
)
);
}
add_action( 'widgets_init', 'twentyseventeen_widgets_init' );
/* footer-widgets.php file */