здесь у меня есть решение для моего собственного вопроса.пусть это поможет другим.
<?php
add_filter( 'wp_nav_menu_items', 'add_archive');
function add_archive($items, $args) {
$l = 0;
$ar = '';
$ar = '';
$ar .= '<li class="parent-category"><a href="#">archives</a><ul class="sub-menu">';
global $wpdb;
$months = $wpdb->get_results("SELECT DISTINCT MONTH( post_date ) AS month , YEAR( post_date ) AS year, COUNT( id ) as post_count FROM $wpdb->posts WHERE post_status = 'publish' and post_date <= now( ) and post_type = 'post' GROUP BY month , year ORDER BY post_date DESC");
foreach($months as $month)
{
if($l==0)
{
$ar .= '<div class="drop-dowm">';
}
elseif($l % 7 ==0)
{
$ar .= '</div><div class="drop-dowm">';
}
$ar .= '<div>';
$ar .= '<a href="'.get_bloginfo('url').'/'. $month->year.'/'.$month->name.date("m", mktime(0, 0, 0, $month->month, 1, $month->year)).'">'.date("F", mktime(0, 0, 0, $month->month, 1, $month->year)).' '. $month->year.'</a>';
$ar .= '</div>';
$l++;
}
$ar .= '</ul></li>';
$items1 .= $ar;
return str_replace('<a href="#">archives</a></li>',$items1,$items);
}
?>