ホーム > vicuna > 「vicuna」をウィジェット対応にする方法

「vicuna」をウィジェット対応にする方法

「wp.vicuna.ext」はwidget対応ですが、「wp.vicuna」は対応していないため、なんとかできないものかと適当に対応させました。
もしこれを参考にされる方は自己責任でお願いします。
1.functions.phpの修正

/**
* Display a tag clouds.
*/

の上に次のようなコードを挿入しました

/* Widget対応 */
register_sidebar(array(
‘name’ => ‘navi’,
‘before_widget’ => “\t\t<dt id=\”".’%1$s’.”\” class=\”widget “.’%1$s’.”\”>”,
‘after_widget’ => “\t\t</dd>\n”,
‘before_title’ => ”,
‘after_title’ => “</dt>\n\t\t<dd>\n”,
));
register_sidebar(array(
‘name’ => ‘others’,
‘before_widget’ => “\t\t<dt id=\”".’%1$s’.”\” class=\”widget “.’%1$s’.”\”>”,
‘after_widget’ => “\t\t</dd>\n”,
‘before_title’ => ”,
‘after_title’ => “</dt>\n\t\t<dd>\n”,
));

2.sidebar.phpの修正
「wp.vicuna」のsidebarは2つに分割されていますので、それぞれ好きな位置に以下のコードを挿入
<dl class=”navi”>より下

<?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘navi’) ) : ?>
<?php endif; ?>

<dl class=”others”>より下

<?php    if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘others’) ) : ?>
<?php endif; ?>

そろそろちゃんとPHPの勉強をしなくちゃなーと思う今日この頃でした。




ホーム > vicuna > 「vicuna」をウィジェット対応にする方法


タグクラウド
おすすめアイテム
FEED & META