This page redirects to an external site: https://developer.wordpress.org/reference/functions/dropdown_cats/
Languages: English • 日本語 (Add your language)
Displays a list of categories in a select (i.e dropdown) box.
<?php dropdown_cats( $optionall, $all, $sort_column,
$sort_order, $optiondates, $optioncount,
$hide_empty, $optionnone, $selected, $hide ); ?>
Displays category select (dropdown) list in HTML form with a submit button, in a WordPress sidebar unordered list.
<li id="categories"><?php _e('Categories:'); ?>
<ul><li>
<form action="<?php echo $PHP_SELF ?>" method="get">
<?php dropdown_cats(); ?>
<input type="submit" name="submit" value="view" />
</form>
</li></ul>
</li>
Displays category select (dropdown) in HTML form without a submit button.
<script type="text/JavaScript">
<!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<form action="">
<select name="menu" onchange="MM_jumpMenu('parent',this,0)">
<option>Choose one</option>
<?php dropdown_cats_exclude('name', 'asc'); ?>
</select>
</form>
When you choose a category when you are not on the main page, you will not move to that category. To fix this find the following line in the template where you are using Dropdown cats. <form action="<?php echo $PHP_SELF ?>" method="get"> Replace it with : <form action="<?bloginfo('url');?>/index.php" method="get">
This is a temporary fix to the problem, a real fix will probably come soon. This problem is usually only found on blogs using Apache Rewrite rules.