<?php
/**
* VetNexusMD Checkmark Fix – Server-Side Solution
* This code MUST be added to functions.php or as a mu-plugin
* It fixes SVGs at the PHP level before HTML is sent to browser
*/
// Method 1: Filter the_content to fix SVGs
add_filter(‘the_content’, ‘vetnexus_fix_svg_checkmarks’, 999999);
function vetnexus_fix_svg_checkmarks($content) {
// Replace SVGs with width/height of 1102
$content = preg_replace(
‘/(<svg[^>]*?)width=[“\’]1102[“\’]([^>]*?)height=[“\’]1102[“\’]/i’,
‘$1width=”24” $2height=”24″‘,
$content
);
// Also fix any SVG with width/height over 100
$content = preg_replace_callback(
‘/(<svg[^>]*?)width=[“\’](\d+)[“\’]([^>]*?)height=[“\’](\d+)[“\’]/i’,
function($matches) {
$width = intval($matches[2]);
$height = intval($matches[4]);
if ($width > 100 || $height > 100) {
return $matches[1] . ‘width=”24″‘ . $matches[3] . ‘height=”24″‘;
}
return $matches[0];
},
$content
);
return $content;
}
// Method 2: Output buffer to catch ALL HTML
add_action(‘init’, ‘vetnexus_start_buffer’, 1);
add_action(‘shutdown’, ‘vetnexus_end_buffer’, 999999);
function vetnexus_start_buffer() {
ob_start(‘vetnexus_fix_all_svgs’);
}
function vetnexus_end_buffer() {
if (ob_get_level()) {
ob_end_flush();
}
}
function vetnexus_fix_all_svgs($html) {
// Fix all SVGs in the entire HTML output
$html = preg_replace(
‘/<svg([^>]*?)width=[“\’]1102[“\’]([^>]*?)height=[“\’]1102[“\’]([^>]*?)>/i’,
‘<svg$1width=”24″$2height=”24″$3>’,
$html
);
// Add CSS to force sizing
$css = ‘<style id=”vetnexus-svg-fix”>
svg[width=”1102″] { width: 24px !important; height: 24px !important; }
.elementor-icon-list-item svg { width: 16px !important; height: 16px !important; }
</style>’;
$html = str_replace(‘</head>’, $css . ‘</head>’, $html);
return $html;
}
// Method 3: Elementor-specific hook
add_action(‘elementor/frontend/after_render’, ‘vetnexus_fix_elementor_svgs’);
function vetnexus_fix_elementor_svgs() {
echo ‘<script>
document.querySelectorAll(“svg”).forEach(function(svg) {
if (svg.getAttribute(“width”) === “1102”) {
svg.setAttribute(“width”, “24”);
svg.setAttribute(“height”, “24”);
}
});
</script>’;
}
// Log success
error_log(‘VetNexusMD: Checkmark fix applied at ‘ . date(‘Y-m-d H:i:s’));
?>
## HOW TO IMPLEMENT THIS FIX:
### Option 1: Add to functions.php
1. Go to WordPress Admin → Appearance → Theme Editor
2. Select functions.php
3. Add this code at the bottom
4. Save and clear ALL caches
### Option 2: Create mu-plugin (MOST RELIABLE)
1. Create file: `/wp-content/mu-plugins/vetnexus-checkmark-fix.php`
2. Add this code
3. No activation needed – runs automatically
### Option 3: Use Code Snippets plugin
1. Install “Code Snippets” plugin
2. Add new snippet with this code
3. Set to run everywhere
4. Activate
## VERIFICATION:
After implementing, check:
– View page source (not inspect element)
– Search for width=”1102″
– Should find ZERO instances
– All SVGs should show width=”24″
Important Notice: This content is for informational purposes only. VetNexusMD provides Independent Medical Opinions based on record review. No diagnosis, treatment, or physician-patient relationship is established. All services are provided via teleconsultation with no in-person examinations.