WordPress Custom Widgets

WordPress Custom Widgets Creation

WordPress Custom Add Widgets

Steps

Register Custom Sidebar

Go to function.php in theme directory

Create the sidebar function

register_sidebar (array(

        /* Sidebar number. */

        ‘name’          => __(‘Sidebar one’,”)

        ‘id’            => ‘sidebar-1’,

        ‘description’   => ”,

        ‘class’         => ”,

        ‘before_widget’ => ‘<li id=”%1$s” class=”widget %2$s”>’,

        ‘after_widget’  => “</li>\n”,

        ‘before_title’  => ‘<h2 class=”widgettitle”>’,

        ‘after_title’   => “</h2>\n”,

    ));

Widget display or call method

add_action( ‘widgets_init’, ‘twentytwenty_sidebar_registration’ );

 One another sidebar creation functions

Function calling method

add_action( ‘widgets_init’, ‘twentytwenty_sidebar_registration’ );