add_filter('wp_get_attachment_image_attributes', function ($attr, $attachment, $size) { // Only affect front-end pages if (is_admin()) { return $attr; } // Default fallback sizes $default_sizes = '(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1200px) 80vw, 1200px'; // Use DOM-friendly approach to get max width if theme sets it if (isset($attr['class'])) { // Attempt to detect width classes like 'wp-image-123' or 'alignwide' if (preg_match('/align(full|wide|left|right)/', $attr['class'], $matches)) { switch ($matches[1]) { case 'full': $attr['sizes'] = '(max-width: 480px) 100vw, (max-width: 768px) 100vw, 1200px'; break; case 'wide': $attr['sizes'] = '(max-width: 480px) 100vw, (max-width: 768px) 95vw, 1100px'; break; default: $attr['sizes'] = '(max-width: 480px) 100vw, (max-width: 768px) 90vw, 800px'; break; } } else { $attr['sizes'] = $default_sizes; } } else { $attr['sizes'] = $default_sizes; } return $attr; }, 10, 3);
Posted inIn The News

Former U.S. Attorney Pak to Jan. 6 Committee: ‘Nothing irregular happened in the counting’ of Fulton County’s votes

A surveillance video then-President Donald Trump’s lawyer played for Georgia lawmakers in December 2020 purportedly revealing ballot-counting irregularities at Atlanta’s State Farm Arena showed nothing illegal, former U.S. Attorney Byung J. “BJay” Pak told a congressional committee Monday.

Gift this article