1
因此,下拉菜单显示所有选项(年,月),但是当我选择它时什么都不做。页面不加载到正确的选项。选择选项时下拉列表不重定向
在这里它的代码,我想这样的事情是缺少,但不知道在哪里添加它
选择的onchange =“document.location.href = this.options [this.selectedIndex] .value的;”
$elem_m = ($args['display_as_dropdown'] === true ? 'select' : 'ul');
$elem_i = ($args['display_as_dropdown'] === true ? '<option value="%s">%s%s</option>' : '<li> <a href="%s">%s</a>%s</li>');
$html = sprintf('<%s>', $elem_m);
foreach(array_slice(($args['order'] === 'desc' ? array_reverse($archives) : $archives), 0, ($args['limit'] === 0 ? NULL : $args['limit'])) as $archive)
{
if($args['type'] === 'yearly')
{
$link = em_get_event_date_link($archive);
$display = $archive;
}
else
{
$date = explode('-', $archive);
$link = em_get_event_date_link($date[0], $date[1]);
$display = $wp_locale->get_month($date[1]).' '.$date[0];
}
$html .= sprintf(
$elem_i,
$link,
$display,
($args['show_post_count'] === true ? ' ('.$counts[$archive].')' : '')
);
}
$html .= sprintf('</%s>', $elem_m);
return $html;
好吧谢谢你的帮助。会添加这个。 – therethere 2014-10-07 13:30:10