2009.12.30

Wordpressのウィジェットを作成、追加する方法

反映させたいテンプレートファイルとfunction.phpへ下記を記述すればいいんじゃないかな?
まだ試してません…

<?php
if ( function_exists(’register_sidebar’) )
register_sidebar(array(
‘name’=>’MiddleColumn’,
‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”mast”>’,
‘after_title’ => ‘</h3>’,
));

register_sidebar(array(
‘name’=>’RightColumn’,
‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”mast”>’,
‘after_title’ => ‘</h3>’,
));





<?php if ( !function_exists(’dynamic_sidebar’)
|| !dynamic_sidebar(’RightColumn’) ) : ?>


<?php if ( !function_exists(’dynamic_sidebar’)
|| !dynamic_sidebar(’MiddleColumn’) ) : ?>