I want to assign different menus based on a user's location. I've installed the GeoIP Detection plugin that detects a user's country code. I assigned the variable $userInfo = geoip\_detect2\_get\_info\_from\_current\_ip() in functions.php and verified it works. I also created two different menus called 'Main Menu' and 'Main Menu International'.

By default, the menu "Main Menu International" (ID 303) is assigned to theme locations "Main Menu" and "Main Menu - Mobile".

But how do I assign the menu "Main Menu" (ID 51) to these two theme locations when isoCode = "TH"?

Here's what I have so far. I need help with figuring out where to put this code, and how edit it to make it assign the menu to both "main" and "mobile" locations.

```
<?php
    if ( $userInfo->country->isoCode == 'TH' ){
        wp_nav_menu(array('menu_id' => 51)); //Main Menu ID
    } else {
        wp_nav_menu(array('menu_id' => 303)); //Main Menu International ID
    }
?>

```

Edit: Getting closer (I think). I replaced the original code with the code below but now the menu with the lower id shows regardless of country or what menu is enabled in the WP admin panel. No matter what parameters in the code I change it still shows the menu with ID 51. 

```
<?php
    if ( $userInfo->country->isoCode == 'TH' ){
        wp_nav_menu(array(
        'menu_id'       => 51,
        'container'     => false,
        'items_wrap'    => '%3$s',
        'depth'         => 0,
        'walker'        => new FlatsomeNavDropdown)); //Main Menu
    } else {
        wp_nav_menu(array(
        'menu_id'       => 303,
        'container'     => false,
        'items_wrap'    => '%3$s',
        'depth'         => 0,
        'walker'        => new FlatsomeNavDropdown)); //Main Menu International
}
?>

```

I'm wondering if I need to replace the number I'm using in menu\_id with the text slug of the menu id. But I can't seem to find this.