if ( ! function_exists( 'bridge_qode_child_theme_enqueue_scripts' ) ) { function bridge_qode_child_theme_enqueue_scripts() { wp_register_style( 'bridge-childstyle', get_stylesheet_directory_uri() . '/style.css' ); wp_enqueue_style( 'bridge-childstyle' ); } add_action( 'wp_enqueue_scripts', 'bridge_qode_child_theme_enqueue_scripts', 11 ); } /** * Fuerza un único meta viewport correcto. */ /* 1) Intenta quitar la función del tema si existe */ add_action( 'after_setup_theme', function () { remove_action( 'wp_head', 'bridge_qode_header_meta' ); }, 999 ); /* 2) Reescribe el HTML final y elimina cualquier viewport previo */ add_action( 'template_redirect', function () { ob_start( function ( $html ) { // Elimina cualquier meta viewport existente, aunque tenga atributos en distinto orden $html = preg_replace( '/]*name=["\']viewport["\'][^>]*>/i', '', $html ); // Inserta un único viewport correcto antes de $viewport = '' . "\n"; if ( stripos( $html, '' ) !== false ) { $html = preg_replace( '/<\/head>/i', $viewport . '', $html, 1 ); } return $html; } ); }, 0 );