<?php
if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly

if( !empty($settings['menu']) ) {

    if( $settings['menu_type'] == 'vertical' ) { // Vertical Menu

        echo '<nav class="rivax-header-v-nav-wrapper">';
        wp_nav_menu( array(
            'menu' => $settings['menu'],
            'link_before' => '<span>',
            'link_after'=>'</span>',
            'fallback_cb' => false,
            'container' => false,
            'menu_class' => 'rivax-header-v-nav',
            'theme_location' => 'primary_menu',
        ) );
        echo '</nav>';

    }
    else { // Horizontal Menu

        $cls = '';
        if($settings['h_menu_hover_shape']) $cls .= ' ' . $settings['h_menu_hover_shape'];
        if($settings['h_mega_menu_width']) $cls .= ' mega-menu-' . $settings['h_mega_menu_width'];

        echo '<nav class="rivax-header-nav-wrapper' . $cls . '">';
        wp_nav_menu( array(
            'menu' => $settings['menu'],
            'link_before' => '<span>',
            'link_after'=>'</span>',
            'fallback_cb' => false,
            'container' => false,
            'menu_class' => 'rivax-header-nav',
			'theme_location' => 'primary_menu',
        ) );
        echo '</nav>';

    }
}
