wordpress widget追加

■functions.php

if(function_exists('register_sidebars')) {
	register_sidebar(array(
		'name' => 'サイドバー1',
		'id' => 'side_widget1',
		'before_title' => '<p class="widget-ttl">',
		'after_title' => '</p>',
		'before_widget' => '<div class="widget">',
		'after_widget' => '</div>',
	));

	register_sidebar(array(
		'name' => 'サイドバー2',
		'id' => 'side_widget2',
		'before_title' => '<p class="widget-ttl">',
		'after_title' => '</p>',
		'before_widget' => '<div class="widget">',
		'after_widget' => '</div>',
	));
}

■example.php

<?php dynamic_sidebar('side_widget1'); ?>
<?php dynamic_sidebar('side_widget2'); ?>
PAGE TOP