<?php
/**
 * The Header Right Sidebar containing the header right widget area
 *
 * @package Catch Themes
 * @subpackage Gridalicious
 * @since Gridalicious 1.0
 */
?>

<?php
/**
 * gridalicious_before_header_right hook
 */
do_action( 'gridalicious_before_header_right' ); ?>

<aside class="sidebar sidebar-header-right widget-area">
	<?php
	if ( has_nav_menu( 'header-right' ) ) {
	?>
    	<nav class="nav-header-right" role="navigation">
            <div class="wrapper">
                <h1 class="assistive-text"><?php _e( 'Header Right Menu', 'gridalicious-pro' ); ?></h1>
                <div class="screen-reader-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'gridalicious-pro' ); ?>"><?php _e( 'Skip to content', 'gridalicious-pro' ); ?></a></div>
                <?php
                    $gridalicious_header_right_menu_args = array(
                        'theme_location'    => 'header-right',
                        'menu_class' => 'menu gridalicious-nav-menu'
                    );
                    wp_nav_menu( $gridalicious_header_right_menu_args );
                ?>
        	</div><!-- .wrapper -->
        </nav><!-- .nav-secondary -->
	<?php
	}

	//Header Right Widgets Sidebar
	if ( is_active_sidebar( 'header-right' ) ) {
	   	dynamic_sidebar( 'header-right' );
	}
	elseif ( !has_nav_menu( 'header-right' ) ) {
		if ( '' != ( $gridalicious_social_icons = gridalicious_get_social_icons() ) ) { ?>
			<section class="widget widget_gridalicious_social_icons" id="header-right-social-icons">
				<div class="widget-wrap">
					<?php echo $gridalicious_social_icons; ?>
				</div>
			</section>
			<?php
			}
        }
	?>
</aside><!-- .sidebar .header-sidebar .widget-area -->

<?php
/**
 * gridalicious_after_header_right hook
 */
do_action( 'gridalicious_after_header_right' );