/', '
' . esc_html($item->description) . '
' . $args->link_after . '', $item_output ); } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'almaira_shop_nav_description', 10, 4 ); /*********************/ /** * Function to check if it is Internet Explorer */ if ( ! function_exists( 'almaira_shop_check_is_ie' ) ) : /** * Function to check if it is Internet Explorer. * * @return true | false boolean */ function almaira_shop_check_is_ie() { $is_ie = false; $ua = htmlentities( $_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, 'UTF-8' ); if ( strpos( $ua, 'Trident/7.0' ) !== false ) { $is_ie = true; } return apply_filters( 'almaira_shop_check_is_ie', $is_ie ); } endif; /** * ratia image */ if ( ! function_exists( 'almaira_shop_replace_header_attr' ) ) : /** * Replace header logo. * * @param array $attr Image. * @param object $attachment Image obj. * @param sting $size Size name. * * @return array Image attr. */ function almaira_shop_replace_header_attr( $attr, $attachment, $size ){ $custom_logo_id = get_theme_mod( 'custom_logo' ); if ( $custom_logo_id == $attachment->ID ){ $attach_data = array(); if ( ! is_customize_preview() ){ $attach_data = wp_get_attachment_image_src( $attachment->ID, 'almaira-logo-size' ); if ( isset( $attach_data[0] ) ) { $attr['src'] = $attach_data[0]; } } $file_type = wp_check_filetype( $attr['src'] ); $file_extension = $file_type['ext']; if ( 'svg' == $file_extension ) { $attr['class'] = 'almaira-logo-svg'; } $retina_logo = get_theme_mod( 'almaira_shop_header_retina_logo' ); $attr['srcset'] = ''; if ( apply_filters( 'almaira_main_header_retina', true ) && '' !== $retina_logo ) { $cutom_logo = wp_get_attachment_image_src( $custom_logo_id, 'full' ); $cutom_logo_url = $cutom_logo[0]; if (almaira_shop_check_is_ie() ){ // Replace header logo url to retina logo url. $attr['src'] = $retina_logo; } $attr['srcset'] = $cutom_logo_url . ' 1x, ' . $retina_logo . ' 2x'; } } return apply_filters( 'almaira_shop_replace_header_attr', $attr ); } endif; add_filter( 'wp_get_attachment_image_attributes', 'almaira_shop_replace_header_attr', 10, 3 ); /** * Return Theme options. */ if ( ! function_exists( 'almaira_shop_get_option' ) ){ /** * Return Theme options. * * @param string $option Option key. * @param string $default Option default value. * @param string $deprecated Option default value. * @return Mixed Return option value. */ function almaira_shop_get_option( $option, $default = '', $deprecated = '' ){ if ( '' != $deprecated ) { $default = $deprecated; } $theme_options = Almaira_Theme_Options::get_options(); /** * Filter the options array for almaira Settings. * * @since 1.0.20 * @var Array */ $theme_options = apply_filters( 'almaira_shop_get_option_array', $theme_options, $option, $default ); $value = ( isset( $theme_options[ $option ] ) && '' !== $theme_options[ $option ] ) ? $theme_options[ $option ] : $default; /** * Dynamic filter almaira_get_option_$option. * $option is the name of the Almaira Shop Setting, Refer Almaira Shop_Theme_Options::defaults() for option names from the theme. * * @since 1.0.20 * @var Mixed. */ return apply_filters( "almaira_shop_get_option_{$option}", $value, $option, $default ); } } /********************************/ // responsive slider function /*********************************/ if ( ! function_exists( 'almaira_shop_responsive_slider_funct' ) ) : function almaira_shop_responsive_slider_funct($control_name,$function_name){ $custom_css=''; $control_value = get_theme_mod( $control_name ); if ( empty( $control_value ) ){ return ''; } if ( almaira_shop_is_json( $control_value ) ){ $control_value = json_decode( $control_value, true ); if ( ! empty( $control_value ) ) { foreach ( $control_value as $key => $value ){ $custom_css .= call_user_func( $function_name, $value, $key ); } } return $custom_css; } } endif; /********************************/ // responsive slider function add media query /********************************/ if ( ! function_exists( 'almaira_shop_add_media_query' ) ) : function almaira_shop_add_media_query( $dimension, $custom_css ){ switch ($dimension){ case 'desktop': $custom_css = '@media (min-width: 769px){' . $custom_css . '}'; break; break; case 'tablet': $custom_css = '@media (max-width: 768px){' . $custom_css . '}'; break; case 'mobile': $custom_css = '@media (max-width: 550px){' . $custom_css . '}'; break; } return $custom_css; } endif; /**************************/ // Dynamic Social Link /**************************/ function almaira_shop_social_links(){ $social=''; $original_color = get_theme_mod('almaira_shop_social_original_color',false); if($original_color==true){ $class_original='original-social-icon'; }else{ $class_original=''; } $social.='