You can place the navigation in a If Else statement, like this:
<?php if ( is_single() ) : // if single show menu ?>
<nav class="navbar navbar-inverse" role="navigation">
<div class="container">
<?php if ( get_theme_mod( 'compose_nav_choice' ) !== 'single' ) : // Which menu are we using? ?>
<div id="primary-navigation" class="site-navigation primary-navigation" role="navigation">
<button class="menu-toggle"><span><?php _e( 'Primary Menu', 'compose' ); ?></span></button>
<a class="screen-reader-text skip-link" href="#content"><?php _e( 'Skip to content', 'compose' ); ?></a>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
</div>
<?php else : ?>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><?php _e( 'Toggle navigation', 'compose' ); ?></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button><!-- /.navbar-toggle -->
</div><!-- /.navbar-header -->
<?php wp_nav_menu( array(
'menu' => 'primary',
'theme_location' => 'primary',
'depth' => 2,
'container' => 'div',
'container_class' => 'collapse navbar-collapse',
'container_id' => 'navbar-collapse',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
'walker' => new wp_bootstrap_navwalker())
);
?>
<?php endif; // End menu choice check ?>
</div><!-- /.container -->
</nav><!-- /.navbar -->
<?php else : // if not single, don't show the menu ?>
<?php endif; ?>
I’d like to say that this will only the show the menu on the single posts page not on the archives, pages or any other page.