title: Wordpress: if post is in category display nav menu
body: <p>How to display different navigation menu based on  <strong>"in what category post is"</strong> ?</p>
  
  <p>I have 2 categories:</p>
  
  <ul>
  <li><strong>address</strong> (link: www.sitename.com/address/)</li>
  <li><strong>info</strong> (link: www.sitename.com/info/)</li>
  </ul>
  
  <p>And I have 3 navigation menu:</p>
  
  <ul>
  <li><strong>navmenu0();</strong> (this menu should be used if "post" is in no category)</li>
  <li><strong>navmenu1();</strong> (this menu should be used if "post" is in category
  "<strong>address</strong>")</li>
  <li><strong>navmenu2();</strong> (this menu should be used if "post" is in category "<strong>info</strong>")</li>
  </ul>
  
  <p>this is the code that I use in header:</p>
  
  <pre><code>    &lt;nav id="menu" role="navigation"&gt;
  
          &lt;?php if (is_category('info')) {
              navmenu2();
          } else if (is_category('address')) {
              navmenu1();
          } else { 
              navmenu0();
          } ?&gt;
  
      &lt;/nav&gt;
  </code></pre>
  
  <p>Problem is when I open post from category "info", the <strong>"if"</strong> those not work and it show "<strong>navmenu0();</strong>" instead of showing <strong>"navmenu2();"</strong></p>