/**
Theme Name: Inficon Global
Author: Inficon Global
Author URI: https://inficonglobal.es/
Description: Tema desarrollado para Concha Vega
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: inficon-global
Template: astra
*/




/*OCULTAR PRECIO VARIACIÓN*/

body .woocommerce-variation-price {
    display: none!important;
}

/* ESTILO PÁGINA MI CUENTA*/

.woocommerce-account .entry-content .woocommerce {
	max-width: 100%!important;
}

.woocommerce-MyAccount-navigation {
	border-color:white!important;
}

.ast-woo-form-actions{
	display:none!important;
}

/*QUITAR ICONO NACEX EN MI CARRITO*/

#shipping_method > li:nth-child(1) > label > img{
	display:none!important;
}

/*ANIMACIÓN FADE-IN PARA IMÁGENES CON LAZYLOAD*/

/* PART 1 - Before Lazy Load */
img[data-lazyloaded]{
    opacity: 0;
}
/* PART 2 - Upon Lazy Load */
img.litespeed-loaded{
    -webkit-transition: opacity .5s linear 0.2s;
    -moz-transition: opacity .5s linear 0.2s;
    transition: opacity .5s linear 0.2s;
    opacity: 1;
}

/*PONER A TODAS LAS IMG EL MISMO ALT*/
function actualizar_alt_imagenes() {
    // Obtener todas las imágenes adjuntas en la biblioteca de medios
    $args = array(
        'post_type' => 'attachment',
        'posts_per_page' => -1, // Obtener todas las imágenes
        'post_mime_type' => 'image', // Solo imágenes
    );
   
    $imagenes = get_posts( $args );
   
    foreach ( $imagenes as $imagen ) {
        // Obtener la URL de la imagen
        $imagen_id = $imagen->ID;
       
        // Nuevo texto para el alt (puedes personalizarlo)
        $nuevo_alt = 'Moda Flamenca Concha Vega'; // Cambia esto por el valor que desees
       
        // Actualizar el atributo alt
        update_post_meta( $imagen_id, '_wp_attachment_image_alt', $nuevo_alt );
    }
}

// Ejecutar la función al activar el tema o plugin
add_action('init', 'actualizar_alt_imagenes');

