function add_custom_menu_item ( $items, $args ) {
if ( $args->theme_location == 'primary') {
$items .= '<li>'.do_shortcode('[woocommerce_currency_switcher_drop_down_box]').'</li>';
}
return $items;
}
add_filter( 'wp_nav_menu_items', 'add_custom_menu_item', 10, 2 );
效果图如下:
