Friday 29 July 2022

Create widgets in wordpress by codex.

 add_filter( 'use_widgets_block_editor', '__return_false' );

// Register sidebars by running tutsplus_widgets_init() on the widgets_init hook.

add_action( 'widgets_init', 'tutsplus_widgets_init' );


function tutsplus_widgets_init() {


    // First footer widget area, located in the footer. Empty by default.

register_sidebar( array(

'name' => __( 'First Footer Widget Area', 'tutsplus' ),

'id' => 'first-footer-widget-area',

'description' => __( 'The first footer widget area', 'tutsplus' ),

'before_widget' => '<div id="%1$s" class="widget-container %2$s">',

'after_widget' => '</div>',

'before_title' => '<h3 class="widget-title">',

'after_title' => '</h3>',

) );

}

No comments:

Post a Comment