title: Show/ Hide Custom WordPress Menu
body: <p>I'm using a custom HTML CSS menu which I like on a WordPress theme. Since I don't know how to make it work from the backend (at all), I'm trying to hide menu items when visiting its page with the help of the page title.</p>
  
  <p>I found out that <code>$single_post_title</code> is the page title in WordPress. So I tried to hide menu items using following code. I used this for other menu items as well.</p>
  
  <pre><code>&lt;?php
      $port = "Portfolio";
      if ($port != $single_post_title) {
          $port = "Portfolio";
  } else {
  ?&gt;
     &lt;style type="text/css"&gt;
         #portfolio{
         display:none;
  }  &lt;/style&gt;
  &lt;?php 
  }
  ?&gt;
  </code></pre>
  
  <p>The menu code:</p>
  
  <pre><code> &lt;div class="col-md-9" class="fancymenu"&gt; 
      &lt;a id="#portfolio" href="/Portfolio/"&gt;&lt;?php echo $port ?&gt;&lt;/a&gt;
      &lt;a id="#about" href="/About-Me/"&gt;&lt;?php echo $about ?&gt;&lt;/a&gt;
      &lt;a id="#contact" href="/Contact-me/"&gt;&lt;?php echo $contact ?&gt;&lt;/a&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>When I keep playing around with this, sometimes it hides (when replacing != with ==) &amp; sometimes it doesn't.</p>
  
  <p>I hope someone could help me figure this out.</p>
  
  <p>Thanks heaps!</p>