当我运行以下代码时。
$args = array(
\'type\' => \'monthly\',
\'limit\' => \'\',
\'format\' => \'option\',
\'before\' => \'\',
\'after\' => \'\',
\'show_post_count\' => false,
\'echo\' => 1,
\'order\' => \'DESC\',
\'post_type\' => \'post\'
)
<select>
<option value=""> Select </option>
<?php
wp_get_archives( $args );
?> </select>
我得到了这个输出
<select>
<option> Select </option>
<option value="http://test.astech-us.com/holistichivorce/2016/03/"> March 2016 </option>
<option value="http://test.astech-us.com/holistichivorce/2016/02/"> February 2016 </option></select>
但我需要输出像WordPress后端过滤器选项。像这样
<select name="m" id="filter-by-date"><option selected="selected" value="0">All dates</option><option value="201603">March 2016</option><option value="201602">February 2016</option></select>
谢谢你,