我试图从下拉列表中只显示选定的类别(或taxomony),现在我的代码跳转到选定类别的另一页。我该怎么做?
$option ;
$categories = get_categories();
foreach ($categories as $category) {
$option .= \'<option value="\'.get_option(\'home\').\'/category/\'.$category->slug.\'">\';
$option .= $category->cat_name;
//$option .= \' (\'.$category->category_count.\')\';
$option .= \'</option>\';
}
echo $option;