wordpress load different menu based on url
<p>I bought a basic WPML plugin yesterday, but I still have a problem regarding the different menus that I need to show according to the url, so, assuming that my primary menu name is "primary" and the second is "secundary", i put a condition on the top of the page. When the url contains "/en/" the "secundary" menu has to be loaded, otherwise the "primary" has to be loaded.</p>

<p>It seems that the following logic</p>

<pre><code>$host = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];  

if (preg_match('/\/en\//',$host))
{
    wp_nav_menu(array('menu' =&gt; 'secundary'));  
} else {
    wp_nav_menu(array('menu' =&gt; 'primary')); 
}
</code></pre>

<p>It doesn't work. Maybe there's something about wp_nav_menu() that I don't know. </p>

<p>Can you help me to understand?</p>