// ============================================
// IMAGE SEO CLASS (FIXED)
// ============================================
if (!class_exists('TimesBull_Image_SEO')) {
class TimesBull_Image_SEO {
private static $instance = null;
private $image_count = 0;
private $featured_image_id = null;
public static function get_instance() {
if (null === self::$instance) {
self::$instance = new self();
}
return self::$instance;
}
private function __construct() {
add_filter('wp_get_attachment_image_attributes', [$this, 'add_image_attributes'], 10, 3);
add_filter('the_content', [$this, 'auto_add_image_alt']);
add_action('add_attachment', [$this, 'auto_image_seo']);
add_action('wp', [$this, 'set_featured_image_id']);
}
public function set_featured_image_id() {
if (is_singular()) {
$this->featured_image_id = get_post_thumbnail_id();
}
}
public function add_image_attributes($attr, $attachment, $size) {
$this->image_count++;
// CRITICAL FIX: Check if this is the featured image
$is_featured = ($attachment->ID === $this->featured_image_id);
if ($is_featured) {
// Featured image - ALWAYS eager, ALWAYS high priority
$attr['loading'] = 'eager';
$attr['fetchpriority'] = 'high';
$attr['decoding'] = 'async';
} elseif ($this->image_count === 1 && !is_admin()) {
// First non-featured image (e.g., logo)
$attr['loading'] = 'eager';
$attr['fetchpriority'] = 'high';
$attr['decoding'] = 'async';
} else {
// All other images - lazy load for performance
$attr['loading'] = 'lazy';
$attr['decoding'] = 'async';
// Remove fetchpriority from lazy images (prevents conflict)
if (isset($attr['fetchpriority'])) {
unset($attr['fetchpriority']);
}
}
// Ensure alt text is never empty
if (empty($attr['alt'])) {
$alt_text = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);
$attr['alt'] = $alt_text ?: get_the_title($attachment->ID);
}
return $attr;
}
public function auto_add_image_alt($content) {
if (empty($content) || !is_singular() || is_admin()) {
return $content;
}
$post_title = esc_attr(get_the_title());
return preg_replace_callback('/
]+)>/i', function($matches) use ($post_title) {
$img_tag = $matches[0];
$attributes = $matches[1];
if (!preg_match('/alt=([\'"])(.*?)\1/i', $attributes, $alt_matches) || empty(trim($alt_matches[2]))) {
if (stripos($attributes, 'alt=') !== false) {
return preg_replace('/alt=([\'"])(.*?)\1/i', 'alt="' . $post_title . '"', $img_tag);
} else {
return str_replace('
$attachment_id,
'post_title' => $clean_title,
'post_excerpt' => $clean_title,
]);
update_post_meta($attachment_id, '_wp_attachment_image_alt', $clean_title);
}
}
TimesBull_Image_SEO::get_instance();
}
Silver Rate Today: Gold and silver prices are declining today, April 13, 2026. As soon as the market opened on the Multi-Commodity Exchange of India (MCX), gold prices witnessed a drop of ₹1,040, while silver prices saw a decline of ₹5,339. With the wedding season set to begin very soon, silver prices may fluctuate once again. If you are considering purchasing silver, you should check the latest rates before doing so.
Silver Prices on MCX:-
Upon the market opening on MCX, the price of silver settled at ₹237,961 per kilogram, whereas on the last trading day of the previous week, silver had closed at ₹243,300 per kilogram. Meanwhile, gold prices remain steady at ₹151,650 per 10 grams; on the last trading day, gold had closed at ₹152,690 per 10 grams. Whether silver prices will rise or fall at the IBJA will become clear at 12:00 PM. However, signals from the commodity market suggest that a decline is likely there as well.
Will Gold Prices Fall on Akshaya Tritiya 2026?
Silver Prices in Delhi:
In Delhi, the price of 1 kilogram of silver remains steady at ₹259,900.
Silver Prices in Mumbai:
In Mumbai, the price of 1 kilogram of silver remains steady at ₹259,900.
Silver Prices in Kolkata:
In Kolkata, the price of 1 kilogram of silver remains steady at ₹259,900.
Silver Prices in Chennai:
In Chennai, the price of 1 kilogram of silver remains steady at ₹264,900.
JEE Main 2026 Session 2 Result
Silver Prices in Hyderabad:
In Hyderabad, the price of 1 kilogram of silver remains steady at ₹264,900.
Silver Prices in Jaipur
In Kolkata, the price of 1 kg of silver remains steady at ₹259,900.
Silver Prices in Bhopal
In Kolkata, the price of 1 kg of silver remains steady at ₹259,900.
Silver Prices in Lucknow
In Kolkata, the price of 1 kg of silver remains steady at ₹259,900.
Silver Prices in Chandigarh
In Kolkata, the price of 1 kg of silver remains steady at ₹259,900.
Why Did Silver Prices Decline?
Several factors are cited as reasons for the recent fluctuations in gold and silver prices. The most significant factors are believed to be a strengthening US dollar and rising bond yields. Additionally, escalating geopolitical tensions in West Asia have once again pushed crude oil prices upward. With crude oil surpassing the $100-per-barrel mark, apprehensions regarding rising inflation have also intensified.