<?php
/**
 * The template part for displaying the Right Nav.
 * 
 * @package Newsxo
 * 
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {	exit; }


if (!function_exists('newsxo_header_right_menu_section')) :
    function newsxo_header_right_menu_section() { ?>
    
        <!-- Right Area-->
        <div class="right-nav">
        <?php 
        $rightnav_elements = newsxo_get_option('newsxo_rightnav_elements');
            foreach($rightnav_elements as $key=> $rightnav__order) {

                if ($rightnav__order == 'header-toggle') {
                    do_action('newsxo_action_sidebar_menu_function');
                }
        
                if ($rightnav__order == 'search') {
                    do_action('newsxo_action_header_search_section');
                }
    
                if ($rightnav__order == 'cart') {
                    do_action('newsxo_action_header_cart_section');
                }
                if ($rightnav__order == 'dark-light') {
                    do_action('newsxo_action_header_dark_switch_section');
                }
                if ($rightnav__order == 'subscribe') {
                    do_action('newsxo_action_header_subs_section');
                }

            }
            ?>
        </div>
        <!--End Right-->
    <?php }
endif;
add_action('newsxo_action_header_right_menu_section', 'newsxo_header_right_menu_section', 6);

do_action('newsxo_action_header_right_menu_section');           