
    
    <?php
    
    if( ! function_exists('codeless_header_logo_helper') ){
        function codeless_header_logo_helper(){

            $logo_iphone = codeless_get_mod('logo_iphone');
            $logo_ipad = codeless_get_mod('logo_ipad');
            $logo_url = codeless_get_mod('logo', get_template_directory_uri() . '/img/logo.png');
            $logo_light_url = codeless_get_mod('logo_light', get_template_directory_uri() . '/img/logo_light.png');
                    
                $hide ='';
                $hide_ipad= '';
                $hide_desktop = '';
                $new_class = '';
                    
            if(!empty($logo_iphone)){
                $hide = ' hide_iphone';
                $new_class .= ' hide_desktop_iphone';
            }    

            if(!empty($logo_ipad)){
                $hide_ipad = ' hide_ipad';
                $new_class .= ' hide_desktop_ipad';
            }

            if( codeless_get_mod('logo_type', 'image') == 'image' )
            {
                
                $logo = ''; 
                $logo_light = '';

                
                if(!empty($logo_url))
                    $logo = "<img class='".$hide.$hide_ipad." dark' src=\"".esc_url($logo_url)."\" alt='".esc_attr__( 'Logo', 'june' )."' />";
                
                if(!empty($logo_light_url))
                    $logo_light = "<img class='".$hide.$hide_ipad." light' src=\"".esc_url($logo_light_url)."\" alt='".esc_attr__( 'Logo', 'june' )."' />";

                
                $logo = '<div id="logo" class="logo_'.codeless_get_mod("logo_type", 'image').$new_class.'">' . "<a href='".esc_url(home_url('/'))."'>".$logo.$logo_light."</a>" . "</div>";

                if(!empty($logo_iphone))
                        $logo .= " <div class='logo_iphone'><a href='".esc_url(home_url('/'))."'><img src=\"".esc_url($logo_iphone)."\" alt='".esc_attr__( 'Logo', 'june' )."' /></a></div>";
                 if(!empty($logo_ipad))
                        $logo .= " <div class='logo_ipad'><a href='".esc_url(home_url('/'))."'><img src=\"".esc_url($logo_ipad)."\" alt='".esc_attr__( 'Logo', 'june' )."' /></a></div>";        


            }
            elseif(codeless_get_mod('logo_type') == 'font')
            {   
                $logo = codeless_get_mod('logo_font_text', get_bloginfo('name'));
                $logo = "<a href='".esc_url(home_url('/'))."' class=\"logo_font cl-responsive_color_".esc_attr( codeless_get_mod( 'logo_font_responsive_color', 'dark' ) )."\">".$logo."</a>";
            }

            return $logo;
        }
    }
            
    echo codeless_header_logo_helper();
            
    ?>
