ログインページにウィジェットを追加

ログインページにウィジェットを追加したいというリクエストがテーマのユーザーからあったので、、、

/**	
 * Create Widget Area
 */
add_action( 'widgets_init', 'my_widgets_init' );

function my_widgets_init() {

	register_sidebar( array(
		'name'		=> esc_html__( 'Login Page', 'raindrops' ),
		'id'		=> 'sidebar-6',
		'description'	=> '',
		'before_widget'	=> '<li id="%1$s" class="%2$s widget">',
		'after_widget'	=> "</li>\n",
		'before_title'	=> "\n\t<h2 class=\"widgettitle\">",
		'after_title'	=> "</h2>\n",
	) );
}
/**
 * Show Widget on login page
 */
add_action( 'login_footer','my_login_widget');

function my_login_widget(){
	
?><ul style="width:320px;margin:auto;background:#fff"><?php
	dynamic_sidebar( 'sidebar-6' );
?></ul><?php
}
[emulsion_relate_posts]