If you don't mind, I'm going to pick apart your code a bit (don't worry, it's to help you!)
There's a couple issue's you're dealing with (and going to be dealing with). First of all, I'd seriously consider sticking within the WordPress ecosystem if you're going to use it, unless you're going Headless with it.
Barring that, let's continue. In general, you shouldn't rely on variables that you haven't defined in your current scope yourself. Who knows where $single_post_title was defined, or if it even was.
WordPress has some relatively 'nicely' named PHP functions to interact with Posts and Pages (many of which will show up as the first result in Google for a search like "Get the current page title in WordPress")
The standard way of getting a page/post title is with the get_the_title() function.
Another issue is that it's quite a mess to load in some CSS to hide an element if you have access to the element's source code, just skip the element conditionally!
Lastly, generally speaking ID's don't need (or rather just shouldn't have) a pound sign in front of them. Languages that target them will put that in there for you. Something else to consider is your hard coded href attributes have upper case letters, like it's a combination of a slug and title. I'd clarify what's what.
All what I said in mind, I'd drop the first block of code you have, and replace the menu code with the following:
<?php $current_page_title = get_the_title();
echo '<div class="col-md-9" class="fancymenu">';
if( $current_page_title != 'Portfolio' ) echo '<a id="portfolio" href="/Portfolio/">Portfolio</a>';
if( $current_page_title != 'About Me' ) echo '<a id="about" href="/About-Me/">About Me</a>';
if( $current_page_title != 'Contact Me' ) echo '<a id="contact" href="/Contact-me/">Contact Me</a>';
echo '</div>';
?>
You could make it even easier to maintain with a simple loop:
<?php
// Get the current Page Title
$current_page_title = get_the_title();
// Define our Pages as an Array
$pages = array( 'Portfolio', 'About Me', 'Contact Me' );
// Loop through that array
foreach( $pages as $page ){
if( $current_page_title != $page ){
// In here, it means the "page" from the array isn't the "current page"
// that's being viewed, so echo out the item.
echo '<a id="'. sanitize_title( $page ) .'" href="'. sanitize_title( $page ) .'">'. $page .'</a>';
}
}
?>
Note the loop as it stands will replace your ID's like about with about-me.
So, now that you've read through allll of that stuff - I'd really consider learning how the WordPress features work, as the Navigation Menu feature handles all of this stuff (and more) for you, and will make maintaining the site in the future much easier. Your current method is more of an HTML/PHP template that uses WordPress solely as the CMS to manage page/post content, which can get cumbersome later unless it's by design.