Replace Default Bumedi Theme Preloader

Add this Code in Appearance>> Theme File Editor>>functions.php

Ps : replace you preloader image path in code : wp-content/uploads/2025/09/medicineEE.gif to Your Preloader Image Path


// Inline GIF preloader as base64 (no white flash)
add_action('wp_head', function() {
    // GIF ka path (server path)
    $rel_path = 'wp-content/uploads/2025/09/medicineEE.gif'; 
    $file_path = ABSPATH . $rel_path;

    if (file_exists($file_path) && is_readable($file_path)) {
        $data = file_get_contents($file_path);
        $base64 = base64_encode($data);
        $data_uri = 'data:image/gif;base64,' . $base64;

        ?>
        <style>
        /* Hide default SVG spinner */
        .site-loading .preloading svg,
        .site-loading .preloading .path,
        .site-loading .preloading .circular {
            display: none !important;
            visibility: hidden !important;
        }

        /* Replace with GIF */
        .site-loading .preloading {
            width: 150px;
            height: 150px;
            margin: 0 auto;
            background: url("<?php echo $data_uri; ?>") center center no-repeat;
            background-size: contain;
            display: block !important;
        }
        </style>
        <?php
    }
});

Leave a Reply

Your email address will not be published. Required fields are marked *