以下の例では、カテゴリIDが30のカテゴリを親に持つ、子カテゴリ一覧を表示します。
[php]
<?php
$categories = get_terms( 'category', array(
'orderby' => 'count',
'hide_empty' => 0,
'child_of' => 30,
) );
foreach($cat…
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>"> <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" /> <?php wp_dropdown_categories('show_option_all='.__('ALL').'&hide_empty=0');?> <input type="submit" id="submit" value="検索" /> </form>Formタグ内の適当な箇所に以下を追加します。
<?php wp_dropdown_categories('show_option_all='.__('ALL').'&hide_empty=0');?>
この投稿へのコメント
コメントはまだありません。