wp_get_archives doesn't take effect from css or html
I'll try to keep it short. So basically I'm trying to add custom item to my menu which in this case is the archive dropdown list with months desc. Everything looks nice and clean but the output of .wp_get_archives
which also ignores all of the css
function add_archive_dropdown($items, $args) {
if( $args-theme_location == 'primary' ){
$items .='li class="nav-item dropdown"'
.'a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"'
.'Archive'
.'/a'
.'ul class="dropdown-menu" style="list-style:none;" aria-labelledby="navbarDropdown"'
.'li'
.'a href="#"'.'August 2018' .'/a'
.'/li'
.'li'
.wp_get_archives( array('type' = 'monthly', 'format' = 'html', 'show_post_count' = $c))
.'/li'
.'/ul'
.'/li';
}
return $items;
}
add_filter('wp_nav_menu_items', 'add_archive_dropdown', 10, 2);
Topic twitter-bootstrap dropdown wp-get-archives archives menus Wordpress
Category Web