<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}
?>
<?php if ( has_nav_menu( 'secondary' ) ) : ?>
    <div id="topheader" class="container clearfix">
        <div class="topinner">
        <?php $theme_options = pmthemes_theme_options();    // Display Social Icons
		if ( isset($theme_options['header_icons']) and $theme_options['header_icons'] == true ) :
			if ( isset($theme_options['topnav_align']) and $theme_options['topnav_align'] == 'top-menu-right' ) :
				pmthemes_display_social_icons();
			endif;
		endif;
		?>
        <nav id="topnav" class="clearfix" role="navigation">
            <button id="topnav-icon"><span class="top-menu-text"><?php _e( 'Menu', 'pmthemes' ); ?></span></button>
            <?php // Display Top Navigation
            wp_nav_menu(array('theme_location' => 'secondary', 'container' => false, 'menu_id' => 'topnav-menu', 'echo' => true, 'fallback_cb' => '', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => ''));
            ?>
        </nav>
        <?php $theme_options = pmthemes_theme_options();    // Display Social Icons
		if ( isset($theme_options['header_icons']) and $theme_options['header_icons'] == true ) :
			if ( isset($theme_options['topnav_align']) and $theme_options['topnav_align'] == 'top-menu-left' ) :
				 pmthemes_display_social_icons();
			endif; 
		endif;
		?>
        </div>
    </div>
<?php endif; ?>