/*
Theme Name: Hello Elementor Child
Theme URI: https://elementor.com/hello-theme/?utm_source=wp-themes&utm_campaign=theme-uri&utm_medium=wp-dash
Template: hello-elementor
Author: Elementor Team
Author URI: https://elementor.com/?utm_source=wp-themes&utm_campaign=author-uri&utm_medium=wp-dash
Description: Hello Elementor is a lightweight and minimalist WordPress theme that was built specifically to work seamlessly with the Elementor site builder plugin. The theme is free, open-source, and designed for users who want a flexible, easy-to-use, and customizable website. The theme, which is optimized for performance, provides a solid foundation for users to build their own unique designs using the Elementor drag-and-drop site builder. Its simplicity and flexibility make it a great choice for both beginners and experienced Web Creators.
Tags: accessibility-ready,flexible-header,custom-colors,custom-menu,custom-logo,featured-images,rtl-language-support,threaded-comments,translation-ready
Version: 3.4.5.1769770566
Updated: 2026-01-30 07:56:06

*/

// Adiciona fetchpriority na imagem
add_filter('wp_get_attachment_image_attributes', function($attr, $attachment, $size) {
    $image_url = wp_get_attachment_url($attachment->ID);
    
    if (strpos($image_url, 'crm-para-whatsapp') !== false) {
        $attr['fetchpriority'] = 'high';
    }
    
    return $attr;
}, 10, 3);

// Preload da imagem
add_action('wp_head', function() {
    if (is_front_page()) {
        echo '<link rel="preload" as="image" href="https://waspeed.com.br/wp-content/uploads/2025/09/crm-para-whatsapp-768x417.png.webp" fetchpriority="high">';
    }
}, 1);
