<?php
/**
* law-firm-lite functions and definitions
*
* @package Law Firm Lite
*/
/* Breadcrumb Begin */
function law_firm_lite_the_breadcrumb() {
if (!is_home()) {
echo '<a href="';
echo esc_url( home_url() );
echo '">';
bloginfo('name');
echo "</a> ";
if (is_category() || is_single()) {
the_category(',');
if (is_single()) {
echo "<span> ";
the_title();
echo "</span> ";
}
} elseif (is_page()) {
echo "<span> ";
the_title();
}
}
}
/* Theme Setup */
if ( ! function_exists( 'law_firm_lite_setup' ) ) :
function law_firm_lite_setup() {
$GLOBALS['content_width'] = apply_filters( 'law_firm_lite_content_width', 640 );
load_theme_textdomain( 'law-firm-lite', get_template_directory() . '/languages' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-slider' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'title-tag' );
add_theme_support( 'align-wide' );
add_theme_support( 'wp-block-styles' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'html5', array( 'comment-list', 'search-form', 'comment-form', ) );
add_theme_support( 'custom-logo', array(
'height' => 240,
'width' => 240,
'flex-height' => true,
) );
add_image_size('law-firm-lite-homepage-thumb',240,145,true);
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'law-firm-lite' ),
) );
add_theme_support( 'custom-background', array(
'default-color' => 'ffffff'
) );
//selective refresh for sidebar and widgets
add_theme_support( 'customize-selective-refresh-widgets' );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/
add_editor_style( array( 'css/editor-style.css', law_firm_lite_font_url() ) );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/
add_editor_style( array( 'css/editor-style.css', law_firm_lite_font_url() ) );
// Theme Activation Notice
global $pagenow;
if (
is_admin()
&&
('themes.php' == $pagenow)
// &&
// isset( $_GET['activated'] )
) {
add_action('admin_notices', 'law_firm_lite_activation_notice');
}
}
endif;
add_action( 'after_setup_theme', 'law_firm_lite_setup' );
// Notice after Theme Activation
function law_firm_lite_activation_notice() {
$law_firm_lite_meta = get_option( 'law_firm_lite_admin_notice' );
if (!$law_firm_lite_meta) {
echo '<div id="law-firm-lite-welcome-notice" class="notice notice-success is-dismissible welcome-notice">';
echo '<div class="law-firm-lite-banner">';
echo '<div class="law-firm-lite-text">';
echo '<h2>' . esc_html__( 'Thanks For Installing the "Law Firm Lite Theme"!', 'law-firm-lite' ) . '</h2>';
echo '<p>' . esc_html__( 'WeâÃÂÃÂre excited to help you get started with your new theme! Set up your website quickly and easily by importing our demo content and customizing it to suit your needs.', 'law-firm-lite' ) . '</p>';
echo '<div class="law-firm-lite-buttons">';
echo '<a href="' . esc_url( admin_url( 'themes.php?page=law_firm_lite_guide' ) ) . '">' . esc_html__( 'Demo Import', 'law-firm-lite' ) . '</a>';
echo '<a href="'. esc_url( 'https://preview.themescaliber.com/doc/free-law-firm/' ) .'" target=_blank>' . esc_html__( 'Documentation', 'law-firm-lite' ) . '</a>';
echo '<a href="'. esc_url( 'https://www.themescaliber.com/products/law-firm-wordpress-theme' ) .'" target=_blank>' . esc_html__( 'Get Premium', 'law-firm-lite' ) . '</a>';
echo '<a href="'. esc_url( 'https://www.themescaliber.com/products/wordpress-theme-bundle' ) .'" target=_blank class="bundle-btn">' . esc_html__( 'Bundle Of 220+ Themes at $119', 'law-firm-lite' ) . '</a>';
echo '</div>';
echo '</div>';
echo '<div class="law-firm-lite-image">';
echo '<img src="' . esc_url(get_template_directory_uri()) . '/inc/getstart/images/bundle-notice.png">';
echo '</div>';
echo '</div>';
echo '</div>';
}
}
/* Theme Widgets Setup */
function law_firm_lite_widgets_init() {
register_sidebar( array(
'name' => __( 'Blog Sidebar', 'law-firm-lite' ),
'description' => __( 'Appears on blog page sidebar', 'law-firm-lite' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Page Sidebar', 'law-firm-lite' ),
'description' => __( 'Appears on page sidebar', 'law-firm-lite' ),
'id' => 'sidebar-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Sidebar 3', 'law-firm-lite' ),
'description' => __( 'Appears on blog page sidebar', 'law-firm-lite' ),
'id' => 'sidebar-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Footer Navigation 1', 'law-firm-lite' ),
'description' => __( 'Appears on footer 1', 'law-firm-lite' ),
'id' => 'footer-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Footer Navigation 2', 'law-firm-lite' ),
'description' => __( 'Appears on footer 2', 'law-firm-lite' ),
'id' => 'footer-2',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Footer Navigation 3', 'law-firm-lite' ),
'description' => __( 'Appears on footer 3', 'law-firm-lite' ),
'id' => 'footer-3',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Footer Navigation 4', 'law-firm-lite' ),
'description' => __( 'Appears on footer 4', 'law-firm-lite' ),
'id' => 'footer-4',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Social Media', 'law-firm-lite' ),
'description' => __( 'Appears on Contact section', 'law-firm-lite' ),
'id' => 'social-links',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Shop Page Sidebar', 'law-firm-lite' ),
'description' => __( 'Appears on shop page', 'law-firm-lite' ),
'id' => 'woocommerce-shop-sidebar',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Single Product Sidebar', 'law-firm-lite' ),
'description' => __( 'Appears on single product page', 'law-firm-lite' ),
'id' => 'woocommerce-single-sidebar',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Footer Social Icon', 'law-firm-lite' ),
'description' => __( 'Appears on right side footer', 'law-firm-lite' ),
'id' => 'footer-icon',
'before_widget' => '<aside id="%1$s" class="widget mb-5 p-3 %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title px-3 py-2">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'law_firm_lite_widgets_init' );
/* Theme Font URL */
function law_firm_lite_font_url() {
$font_family = array(
'ABeeZee:ital@0;1',
'Abril Fatface',
'Acme',
'Alfa Slab One',
'Allura',
'Anton',
'Architects Daughter',
'Archivo:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Arimo:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700',
'Arsenal:ital,wght@0,400;0,700;1,400;1,700',
'Arvo:ital,wght@0,400;0,700;1,400;1,700',
'Alegreya Sans:ital,wght@0,100;0,300;0,400;0,500;0,700;0,800;0,900;1,100;1,300;1,400;1,500;1,700;1,800;1,900',
'Asap:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Assistant:wght@200;300;400;500;600;700;800',
'Averia Serif Libre:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700',
'Bangers',
'Boogaloo',
'Bad Script',
'Barlow Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Bitter:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Bree Serif',
'BenchNine:wght@300;400;700',
'Cabin:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700',
'Cardo:ital,wght@0,400;0,700;1,400',
'Courgette',
'Caveat Brush',
'Cherry Swash:wght@400;700',
'Cormorant Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700',
'Crimson Text:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700',
'Cuprum:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700',
'Cookie',
'Coming Soon',
'Charm:wght@400;700',
'Chewy',
'Days One',
'DM Serif Display:ital@0;1',
'Dosis:wght@200;300;400;500;600;700;800',
'EB Garamond:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800',
'Economica:ital,wght@0,400;0,700;1,400;1,700',
'Exo 2:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,400;1,500;1,600;1,700;1,800;1,900',
'Fira Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Fredoka One',
'Fjalla One',
'Frank Ruhl Libre:wght@300;400;500;700;900',
'Gabriela',
'Gloria Hallelujah',
'Great Vibes',
'Handlee',
'Hammersmith One',
'Heebo:wght@100;200;300;400;500;600;700;800;900',
'Hind:wght@300;400;500;600;700',
'Inconsolata:wght@200;300;400;500;600;700;800;900',
'Indie Flower',
'IM Fell English SC',
'Julius Sans One',
'Jomhuria',
'Josefin Slab:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700',
'Josefin Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700',
'Jost:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Kaushan Script',
'Krub:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;1,200;1,300;1,400;1,500;1,600;1,700',
'Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900',
'Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700',
'Libre Baskerville:ital,wght@0,400;0,700;1,400',
'Literata:ital,opsz,wght@0,7..72,200;0,7..72,300;0,7..72,400;0,7..72,500;0,7..72,600;0,7..72,700;0,7..72,800;0,7..72,900;1,7..72,200;1,7..72,300;1,7..72,400;1,7..72,500;1,7..72,600;1,7..72,700;1,7..72,800;1,7..72,900',
'Lobster',
'Lobster Two:ital,wght@0,400;0,700;1,400;1,700',
'Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900',
'Marck Script',
'Marcellus',
'Merienda One',
'Monda:wght@400;700',
'Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Mulish:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;0,1000;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900;1,1000',
'Noto Serif:ital,wght@0,400;0,700;1,400;1,700',
'Nunito Sans:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900',
'Open Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800',
'Overpass:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Overpass Mono:wght@300;400;500;600;700',
'Oxygen:wght@300;400;700',
'Oswald:wght@200;300;400;500;600;700',
'Orbitron:wght@400;500;600;700;800;900',
'Patua One',
'Pacifico',
'Padauk:wght@400;700',
'Playball',
'Playfair Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900',
'Prompt:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'PT Sans:ital,wght@0,400;0,700;1,400;1,700',
'PT Serif:ital,wght@0,400;0,700;1,400;1,700',
'Philosopher:ital,wght@0,400;0,700;1,400;1,700',
'Permanent Marker',
'Poiret One',
'Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Prata',
'Quicksand:wght@300;400;500;600;700',
'Quattrocento Sans:ital,wght@0,400;0,700;1,400;1,700',
'Raleway:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900',
'Roboto Condensed:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700',
'Rokkitt:wght@100;200;300;400;500;600;700;800;900',
'Ropa Sans:ital@0;1',
'Russo One',
'Righteous',
'Saira:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Satisfy',
'Sen:wght@400;700;800',
'Source Sans Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900',
'Shadows Into Light Two',
'Shadows Into Light',
'Sacramento',
'Sail',
'Shrikhand',
'Staatliches',
'Stylish',
'Tangerine:wght@400;700',
'Titillium Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700',
'Trirong:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700',
'Unica One',
'VT323',
'Varela Round',
'Vampiro One',
'Vollkorn:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900',
'Volkhov:ital,wght@0,400;0,700;1,400;1,700',
'Work Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900',
'Yanone Kaffeesatz:wght@200;300;400;500;600;700',
'ZCOOL XiaoWei'
);
$query_args = array(
'family' => rawurlencode(implode('|',$font_family)),
);
$font_url = add_query_arg($query_args,'//fonts.googleapis.com/css');
return $font_url;
$contents = law_firm_lite_wptt_get_webfont_url( esc_url_raw( $fonts_url ) );
}
/* Theme enqueue scripts */
function law_firm_lite_scripts() {
wp_enqueue_style( 'law-firm-lite-font', law_firm_lite_font_url(), array() );
/* WB-v22 P0: éÃÂÃÂéæÃÂéáõçæÃÂçÃÂè Google Fonts */
if ( ! is_front_page() ) {
wp_dequeue_style( 'law-firm-lite-font' );
wp_deregister_style( 'law-firm-lite-font' );
}
wp_enqueue_style( 'law-firm-lite-block-style', get_theme_file_uri('/assets/css/blocks.css') );
wp_enqueue_style( 'law-firm-lite-block-patterns-style-frontend', get_theme_file_uri('/inc/block-patterns/css/block-frontend.css') );
wp_enqueue_style( 'bootstrap-style', get_template_directory_uri().'/assets/css/bootstrap.css' );
wp_enqueue_style( 'law-firm-lite-basic-style', get_stylesheet_uri() );
require get_parent_theme_file_path( '/inline-style.php' );
wp_add_inline_style( 'law-firm-lite-basic-style',$law_firm_lite_custom_css );
wp_enqueue_style( 'font-awesome-css', get_template_directory_uri().'/assets/css/fontawesome-all.css' );
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/assets/js/bootstrap.js', array('jquery') ,'',true);
wp_enqueue_script( 'jquery-superfish-js', get_template_directory_uri() . '/assets/js/jquery.superfish.js', array('jquery') ,'',true);
wp_enqueue_script( 'law-firm-lite-custom-scripts', get_template_directory_uri() . '/assets/js/custom.js', array('jquery') );
wp_enqueue_script( 'SmoothScroll-js', get_template_directory_uri() . '/assets/js/SmoothScroll.js', array('jquery') );
if (get_theme_mod('law_firm_lite_animation', true) == true){
wp_enqueue_script( 'jquery-wow', get_template_directory_uri() . '/assets/js/wow.js', array('jquery') );
wp_enqueue_style( 'animate-css', get_template_directory_uri().'/assets/css/animate.css' );
}
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
/* Enqueue the Dashicons script */
wp_enqueue_style( 'dashicons' );
}
add_action( 'wp_enqueue_scripts', 'law_firm_lite_scripts' );
/**
* Enqueue block editor style
*/
function law_firm_lite_block_editor_styles() {
wp_enqueue_style( 'law-firm-lite-font', law_firm_lite_font_url(), array() );
wp_enqueue_style( 'law-firm-lite-block-patterns-style-editor', get_theme_file_uri( '/inc/block-patterns/css/block-editor.css' ), false, '1.0', 'all' );
wp_enqueue_style( 'bootstrap-style', get_template_directory_uri().'/assets/css/bootstrap.css' );
wp_enqueue_style( 'font-awesome', get_template_directory_uri().'/assets/css/fontawesome-all.css' );
}
add_action( 'enqueue_block_editor_assets', 'law_firm_lite_block_editor_styles' );
function law_firm_lite_sanitize_dropdown_pages( $page_id, $setting ) {
// Ensure $input is an absolute integer.
$page_id = absint( $page_id );
// If $page_id is an ID of a published page, return it; otherwise, return the default.
return ( 'publish' == get_post_status( $page_id ) ? $page_id : $setting->default );
}
/*radio button sanitization*/
function law_firm_lite_sanitize_choices( $input, $setting ) {
global $wp_customize;
$control = $wp_customize->get_control( $setting->id );
if ( array_key_exists( $input, $control->choices ) ) {
return $input;
} else {
return $setting->default;
}
}
function law_firm_lite_sanitize_float( $input ) {
return filter_var($input, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
}
function law_firm_lite_sanitize_number_range( $number, $setting ) {
$number = absint( $number );
$atts = $setting->manager->get_control( $setting->id )->input_attrs;
$min = ( isset( $atts['min'] ) ? $atts['min'] : $number );
$max = ( isset( $atts['max'] ) ? $atts['max'] : $number );
$step = ( isset( $atts['step'] ) ? $atts['step'] : 1 );
return ( $min <= $number && $number <= $max && is_int( $number / $step ) ? $number : $setting->default );
}
function law_firm_lite_sanitize_phone_number( $phone ) {
return preg_replace( '/[^\d+]/', '', $phone );
}
/* Excerpt Limit Begin */
function law_firm_lite_string_limit_words($string, $word_limit) {
$words = explode(' ', $string, ($word_limit + 1));
if(count($words) > $word_limit)
array_pop($words);
return implode(' ', $words);
}
// Change number or products per row to 3
add_filter('loop_shop_columns', 'law_firm_lite_loop_columns');
if (!function_exists('law_firm_lite_loop_columns')) {
function law_firm_lite_loop_columns() {
return get_theme_mod( 'law_firm_lite_products_per_row', '3' );
// 3 products per row
}
}
//Change number of products that are displayed per page (shop page)
add_filter( 'loop_shop_per_page', 'law_firm_lite_products_per_page' );
function law_firm_lite_products_per_page( $cols ) {
return get_theme_mod( 'law_firm_lite_products_per_page',9);
}
function law_firm_lite_logo_title_hide_show(){
if(get_theme_mod('law_firm_lite_logo_title_hide_show') == '1' ) {
return true;
}
return false;
}
function law_firm_lite_tagline_hide_show(){
if(get_theme_mod('law_firm_lite_tagline_hide_show',0) == '1' ) {
return true;
}
return false;
}
add_action( 'wp_ajax_law_firm_lite_reset_all_settings', 'law_firm_lite_reset_all_settings' );
function law_firm_lite_reset_all_settings() {remove_theme_mod( 'law_firm_lite_copyright_padding_top_bottom' );
remove_theme_mod( 'law_firm_lite_slider_arrows' );
remove_theme_mod( 'law_firm_lite_slider_page' );
remove_theme_mod( 'law_firm_lite_slider_button_icon' );
remove_theme_mod( 'law_firm_lite_slider_button_text' );
remove_theme_mod( 'law_firm_lite_slider_content_option' );
remove_theme_mod( 'law_firm_lite_slider_content_padding_top_bottom' );
remove_theme_mod( 'law_firm_lite_slider_content_padding_left_right' );
remove_theme_mod( 'law_firm_lite_slider_excerpt_number' );
remove_theme_mod( 'law_firm_lite_slider_opacity_color' );
remove_theme_mod( 'law_firm_lite_slider_height' );
remove_theme_mod( 'law_firm_lite_slider_speed' );
remove_theme_mod( 'law_firm_lite_footer_background_color' );
remove_theme_mod( 'law_firm_lite_footer_text' );
remove_theme_mod( 'law_firm_lite_copyright_font_size' );
remove_theme_mod( 'law_firm_lite_copyright_padding_top_bottom' );
remove_theme_mod( 'law_firm_lite_copyright_alingment' );
remove_theme_mod( 'law_firm_lite_hide_show_scroll' );
remove_theme_mod( 'law_firm_lite_scroll_icon' );
remove_theme_mod( 'law_firm_lite_scroll_to_top_font_size' );
remove_theme_mod( 'law_firm_lite_scroll_to_top_padding' );
remove_theme_mod( 'law_firm_lite_scroll_to_top_width' );
remove_theme_mod( 'law_firm_lite_scroll_to_top_height' );
remove_theme_mod( 'law_firm_lite_scroll_to_top_border_radius' );
remove_theme_mod( 'law_firm_lite_scroll_top_alignment' );
wp_send_json_success(
array(
'success' => true,
'message' => "Reset Completed",
)
);
}
//Active Callback
function law_firm_lite_default_slider(){
if(get_theme_mod('law_firm_lite_slider_type', 'Default slider') == 'Default slider' ) {
return true;
}
return false;
}
function law_firm_lite_advance_slider(){
if(get_theme_mod('law_firm_lite_slider_type', 'Default slider') == 'Advance slider' ) {
return true;
}
return false;
}
function law_firm_lite_blog_post_featured_image_dimension(){
if(get_theme_mod('law_firm_lite_blog_post_featured_image_dimension') == 'custom' ) {
return true;
}
return false;
}
// edit
if (!function_exists('law_firm_lite_edit_link')) :
function law_firm_lite_edit_link($view = 'default')
{
global $post;
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__('Edit <span class="screen-reader-text">%s</span>', 'law-firm-lite'),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
),
'<span class="edit-link"><i class="fas fa-edit"></i>',
'</span>'
);
}
endif;
/* Implement the Custom Header feature. */
require get_template_directory() . '/inc/custom-header.php';
function law_firm_lite_init_setup() {
/* Custom template tags for this theme. */
require get_template_directory() . '/inc/template-tags.php';
/* Customizer additions. */
require get_template_directory() . '/inc/customizer.php';
/* Customizer additions. */
require get_template_directory() . '/inc/themes-widgets/social-icon.php';
/* Customizer additions. */
require get_template_directory() . '/inc/themes-widgets/about-us-widget.php';
/* Customizer additions. */
require get_template_directory() . '/inc/themes-widgets/contact-us-widget.php';
/* Typography */
require get_template_directory() . '/inc/typography/ctypo.php';
/* Implement the About theme page */
require get_template_directory() . '/inc/getstart/getstart.php';
/* Block Pattern */
require get_template_directory() . '/inc/block-patterns/block-patterns.php';
/* TGM Plugin Activation */
require get_template_directory() . '/inc/tgm/tgm.php';
/* Webfonts */
require get_template_directory() . '/inc/wptt-webfont-loader.php';
//define
define('LAW_FIRM_LITE_FREE_THEME_DOC',__('https://preview.themescaliber.com/doc/free-law-firm/','law-firm-lite'));
define('LAW_FIRM_LITE_SUPPORT',__('https://wordpress.org/support/theme/law-firm-lite/','law-firm-lite'));
define('LAW_FIRM_LITE_REVIEW',__('https://wordpress.org/support/theme/law-firm-lite/reviews/','law-firm-lite'));
define('LAW_FIRM_LITE_BUY_NOW',__('https://www.themescaliber.com/products/law-firm-wordpress-theme','law-firm-lite'));
define('LAW_FIRM_LITE_LIVE_DEMO',__('https://preview.themescaliber.com/tc-law-firm-pro/','law-firm-lite'));
define('LAW_FIRM_LITE_PRO_DOC',__('https://preview.themescaliber.com/doc/law-firm-pro/','law-firm-lite'));
define('LAW_FIRM_LITE_FAQ',__('https://www.vwthemes.com/faqs/','law-firm-lite'));
define('LAW_FIRM_LITE_CHILD_THEME',__('https://developer.wordpress.org/themes/advanced-topics/child-themes/','law-firm-lite'));
define('LAW_FIRM_LITE_CONTACT',__('https://www.vwthemes.com/contact/','law-firm-lite'));
define('LAW_FIRM_LITE_CREDIT',__('https://www.themescaliber.com/products/free-law-firm-wordpress-theme','law-firm-lite'));
define('LAW_FIRM_LITE_THEME_BUNDLE_BUY_NOW',__('https://www.themescaliber.com/products/wordpress-theme-bundle','law-firm-lite'));
if ( ! function_exists( 'law_firm_lite_credit' ) ) {
function law_firm_lite_credit(){
echo "<a href=".esc_url(LAW_FIRM_LITE_CREDIT)." target='_blank'>".esc_html__('Law Firm WordPress Theme','law-firm-lite')."</a>";
}
}
}
add_action( 'after_setup_theme', 'law_firm_lite_init_setup' );
// Admin notice code START
function law_firm_lite_dismissed_notice() {
update_option( 'law_firm_lite_admin_notice', true );
}
add_action( 'wp_ajax_law_firm_lite_dismissed_notice', 'law_firm_lite_dismissed_notice' );
//After Switch theme function
add_action('after_switch_theme', 'law_firm_lite_getstart_setup_options');
function law_firm_lite_getstart_setup_options () {
update_option('law_firm_lite_admin_notice', false );
}
// Admin notice code END
/**
* WB-UI-Unify Patch v1.0 âÃÂàÃÂ¥ÃÂ
èçëÃÂäøûéâÃÂ/UIäøÃÂèÃÂôæÃÂçèáÃ¥äøÃÂ
* çÃÂîæàÃÂïüÃÂèîéÃÂ¥ÃÂÃÂ
éáõÃÂ¥ÃÂèÃÂ¥ÃÂÃÂäýÃÂãÃÂÃÂÃ¥ïüèÃÂêæáÃÂæÃÂöãÃÂÃÂæÃÂÃÂéÃÂîãÃÂÃÂæàÃÂéâÃÂÃ¥ñÃÂçúçäøÃÂäøÃÂéæÃÂéáõäÿÃÂæÃÂÃÂäøÃÂèÃÂôãÃÂÃÂ
* èïôæÃÂÃÂïüÃÂéÃÂÃÂèÿàwp_head èþÃÂÃÂ¥ÃÂúÃÂ¥ÃÂÃÂ
èÃÂàCSSïüÃÂçÃÂôæÃÂÃ¥äýÃÂçÃÂèäúàHTMLïüÃÂäøÃÂäþÃÂèõàAutoptimize/CSS ÃÂ¥ÃÂÃÂÃ¥ùöçüÃÂÃÂ¥ÃÂÃÂãÃÂÃÂ
*/
if ( ! function_exists( 'wb_ui_unify_patch_css' ) ) {
function wb_ui_unify_patch_css() {
echo '<style id="wb-ui-unify-patch">';
echo 'body.wb-unify, body.wb-unify button, body.wb-unify input, body.wb-unify select, body.wb-unify textarea, body.wb-unify h1, body.wb-unify h2, body.wb-unify h3, body.wb-unify h4, body.wb-unify h5, body.wb-unify h6 { font-family: "PingFang SC","Microsoft YaHei","Noto Sans SC",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif !important; }';
echo 'body.wb-unify header[role="banner"]:not(.wb-top), body.wb-unify #masthead:not(.wb-top) { display:none !important; visibility:hidden !important; height:0 !important; min-height:0 !important; overflow:hidden !important; }';
echo 'body.wb-unify aside#search, body.wb-unify aside#archives, body.wb-unify aside#meta, body.wb-unify aside#categories, body.wb-unify #secondary, body.wb-unify #sidebar { display:none !important; }';
echo 'body.wb-unify h1 ~ h1 { position:absolute !important; left:-9999px !important; width:1px !important; height:1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; margin:0 !important; padding:0 !important; border:0 !important; }';
echo 'body.wb-unify .bh-btn--gold, body.wb-unify .wb-cta a, body.wb-unify .wb-btn--gold, body.wb-unify .hero__cta a:first-child, body.wb-unify .sos__links a, body.wb-unify .wb-footer__cta a { background-color:#C9A96E !important; color:#0A1628 !important; border-color:#C9A96E !important; }';
echo 'body.wb-unify .bh-btn--ghost, body.wb-unify .wb-btn--ghost, body.wb-unify .hero__cta a:last-child { background-color:transparent !important; color:#C9A96E !important; border:1px solid #C9A96E !important; }';
echo '/* WB-UI-Unify v1.1 äÿîÃ¥äÃÂïüÃÂéáöæàÃÂäøÃÂæÃÂÃÂèÃÂÃÂÃÂ¥ÃÂÃÂèâë header èãÃÂÃÂ¥ÃÂà*/';
echo 'body.wb-unify header.wb-top#wbTopHeader { overflow: visible !important; max-height: none !important; }';
echo 'body.wb-unify .wb-nav__drop-menu { overflow: visible !important; }';
echo 'body.wb-unify .wb-nav__drop-menu a { display: block !important; white-space: nowrap !important; }';
echo 'body.wb-unify nav.wb-mnav#wbMNav.open { max-height: none !important; overflow: visible !important; }';
echo '/* WB-UI-Unify v1.2 äÿîÃ¥äÃÂïüÃÂèæÃÂçÃÂàwb-design-systemïüÃÂçûÃÂäøÃÂéáöæàÃÂéÃÂþæÃÂÃÂ¥/çÃÂõèïÃÂ/æñÃÂÃ¥àáæà÷Ã¥üà*/';
echo 'body.wb-unify header.wb-top#wbTopHeader .wb-nav > a, body.wb-unify header.wb-top#wbTopHeader .wb-nav__drop-trigger, body.wb-unify header.wb-top#wbTopHeader .wb-nav__drop-menu > a { color:#FAF8F5 !important; text-decoration:none !important; padding:8px 12px !important; border-radius:4px !important; font-size:14px !important; white-space:nowrap !important; display:inline-block !important; }';
echo 'body.wb-unify header.wb-top#wbTopHeader .wb-nav > a.current-menu-item, body.wb-unify header.wb-top#wbTopHeader .wb-nav > a.current_page_item { color:#C9A96E !important; }';
echo 'body.wb-unify header.wb-top#wbTopHeader .wb-tel { display:flex !important; align-items:center !important; gap:6px !important; color:#C9A96E !important; text-decoration:none !important; padding:8px 16px !important; border:1px solid #C9A96E !important; border-radius:6px !important; font-size:14px !important; white-space:nowrap !important; flex-shrink:0 !important; }';
echo 'body.wb-unify header.wb-top#wbTopHeader .wb-burger { display:none !important; }';
echo '</style>';
}
add_action( 'wp_head', 'wb_ui_unify_patch_css', 5 );
}
/* ============================================================
* WB-UI-Consistency Patch v21 (2026-07-31)
* çÃÂîæàÃÂïüÃÂäûÃ¥éæÃÂéáõäøúÃÂ¥ÃÂúÃÂ¥ÃÂÃÂïüÃÂçûÃÂäøÃÂÃÂ¥ÃÂ
èçëÃÂäøûéâÃÂ/UI æáÃÂæÃÂöãÃÂÃÂH1ãÃÂÃÂviewportãÃÂÃÂÃ¥ïüèÃÂêãÃÂÃÂ
* ÃÂ¥ÃÂÃÂçÃÂÃÂïüÃÂéÃÂÃÂèÿÃÂéëÃÂäüÃÂÃÂ¥ÃÂ
ÃÂçúç wp_head / wp_footer èþÃÂÃÂ¥ÃÂúèæÃÂçÃÂÃÂèçÃÂÃÂ¥ÃÂÃÂïüÃÂ
* äøÃÂæÃÂùÃÂ¥ÃÂèÃÂ¥ÃÂêèïû mu-pluginsïüÃÂÃÂ¥ÃÂïéÃÂÃÂäøûéâÃÂæÃÂôæÃÂðæÃÂÃÂäùÃÂ
çÃÂÃÂæÃÂÃÂãÃÂÃÂ
* ============================================================ */
/* 1) viewport çûÃÂäøÃÂïüÃÂççûéÃÂä theme çÃÂàmaximum-scale=1.2ïüÃÂÃ¥ùöÃÂ¥ÃÂÃÂÃÂ¥ÃÂ
Ã¥éæÃÂéáõÃÂ¥ÃÂÃÂæìþ */
add_action( 'template_redirect', function() {
if ( is_admin() || is_feed() ) { return; }
ob_start( function( $html ) {
if ( ! is_string( $html ) || $html === '' ) { return $html; }
$orig = $html;
// ÃÂ¥ÃÂàéÃÂä maximum-scale=1.2
$t = preg_replace( '~(<meta[^>]*name="viewport"[^>]*content="[^"]*?),\s*maximum-scale=1\.2([^"]*")~', '$1$2', $html, 1 );
if ( is_string( $t ) && $t !== '' ) { $html = $t; }
// çûÃÂäøÃÂäøúéæÃÂéáõæàÃÂÃÂ¥ÃÂàviewport
$html = preg_replace( '~<meta[^>]*name="viewport"[^>]*>~i', '<meta name="viewport" content="width=device-width, initial-scale=1">', $html, 1 );
return ( $html === '' ) ? $orig : $html;
} );
}, 5 );
/* 2) Ã¥ïüèÃÂêäÿîÃ¥äÃÂïüÃÂÃ¥ýÃÂÃÂ¥ÃÂÃÂéáõäøÃÂæÃÂÃÂéáùçüúÃ¥äñ wb-nav__drop-trigger æÃÂöïüÃÂJS èáÃÂ¥ÃÂ¥ÃÂà+ ÃÂ¥ÃÂÃÂÃ¥ùö class */
add_action( 'wp_footer', function() {
/* ============================================================
* WB-UI-Consistency Patch v22 (2026-08-01)
* äûÃ¥éæÃÂéáõäøúÃÂ¥ÃÂúÃÂ¥ÃÂÃÂçûÃÂäøÃÂÃÂ¥ÃÂ
èçëàHero/æõîÃÂ¥ÃÂèæÃÂÃÂéÃÂî/H1/Header æáÃÂæÃÂöãÃÂÃÂ
* ============================================================ */
/* P1: Hero ÃÂ¥ÃÂ
èÃ¥îýÃÂ¥ÃÂàâÃÂàÃ¥ïùéýÃÂéæÃÂéáõ full-bleed hero */
add_action( 'wp_head', function() {
if ( is_front_page() ) { return; }
echo '<style id="wb-hero-fw-v22">';
echo 'body.wb-unify .wb-hero{width:100vw!important;max-width:none!important;margin-left:calc((100vw - 100%)/-2)!important;padding:0!important;}';
echo 'body.wb-unify .wb-hero__in{max-width:1200px;margin:0 auto;padding:0 24px;}';
echo '</style>';
}, 25 );
/* P1: ÃÂ¥ÃÂÃÂçñû/Ã¥ýÃÂæáãéáõ H1 æÃÂâÃ¥äÃÂæÃÂþçäú */
add_action( 'wp_head', function() {
echo '<style id="wb-cat-h1-v22">';
echo 'body.wb-unify.archive .page-title,body.wb-unify.category .page-title,body.wb-unify.tax .page-title{display:block!important;font-size:44px!important;font-weight:800!important;color:#FAF8F5!important;}';
echo '</style>';
}, 24 );
/* P2: ÃÂ¥ÃÂ
èÃ¥ñÃÂæõîÃÂ¥ÃÂèÃÂ¥ÃÂèèïâæÃÂÃÂéÃÂî */
add_action( 'wp_footer', function() {
if ( is_front_page() ) { return; }
?>
<div class="float">
<a class="float__tel" href="tel:18511835733" aria-label="çÃÂõèïÃÂÃÂ¥ÃÂèèïâ">☎</a>
<button class="float__wx" onclick="var el=document.getElementById('wxpop');if(el)el.classList.toggle('on')" aria-label="Ã¥þîäÿáÃÂ¥ÃÂèèïâ">💬</button>
</div>
<style id="wb-float-v22">
.float{position:fixed;right:20px;bottom:24px;z-index:95;display:flex;flex-direction:column;gap:10px}
.float a,.float button{width:52px;height:52px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:22px;cursor:pointer;border:none;box-shadow:0 8px 22px rgba(10,22,40,.30);transition:all .24s ease-out}
.float__tel{background:#8B1A1A;color:#fff}
.float__wx{background:linear-gradient(135deg,#C9A96E,#B8935A);color:#0A1628}
@media(max-width:768px){.float{right:12px;bottom:16px}.float a,.float button{width:46px;height:46px;font-size:19px}}
/* P1 Hero full-width */
body.wb-unify .wb-hero{width:100vw!important;max-width:none!important;margin-left:calc((100vw - 100%)/-2)!important;padding:0!important}
body.wb-unify .wb-hero__in{max-width:1200px;margin:0 auto;padding:0 24px}
/* P1 Category H1 restore */
body.wb-unify.archive .page-title,body.wb-unify.category .page-title,body.wb-unify.tax .page-title{display:block!important;font-size:44px!important;font-weight:800!important;color:#FAF8F5!important}
/* P2+P3 Header hide + hero h1 */
body.wb-unify header[role="banner"]:not(.wb-top),body.wb-unify header:not([class]):not([id]){display:none!important;visibility:hidden!important;height:0!important;overflow:hidden!important}
body.wb-unify .hero h1{font-size:44px!important;font-weight:800!important;line-height:1.25!important}
@media(max-width:1200px){body.wb-unify .hero h1{font-size:32px!important}}
</style>
<?php
}, 25 );
/* P2+P3: éÃÂÃÂæüàheader éÃÂÃÂèÃÂà+ .hero h1 çûÃÂäøà*/
add_action( 'wp_head', function() {
echo '<style id="wb-fix-v22">';
echo 'body.wb-unify header[role="banner"]:not(.wb-top),body.wb-unify header:not([class]):not([id]){display:none!important;visibility:hidden!important;height:0!important;overflow:hidden!important;}';
echo 'body.wb-unify .hero h1{font-size:44px!important;font-weight:800!important;line-height:1.25!important}';
echo '@media(max-width:1200px){body.wb-unify .hero h1{font-size:32px!important}}';
echo '</style>';
}, 26 );
?>
<script id="wb-nav-class-fix">
(function(){
document.querySelectorAll('header.wb-top .wb-nav > .wb-nav__drop > a').forEach(function(a){
if (a.classList.contains('current-menu-item') || a.classList.contains('current_page_item')) {
if (!a.classList.contains('wb-nav__drop-trigger')) { a.classList.add('wb-nav__drop-trigger'); }
}
});
})();
</script>
<?php
}, 20 );
/* 3) H1 / hero çûÃÂäøÃÂïüÃÂÃÂ¥ÃÂÃÂ
éáõ .wb-hero h1 çûÃÂäøÃÂäøú 44pxïüÃÂäøÃÂéæÃÂéáõæàÃÂÃÂ¥ÃÂÃÂäøÃÂèÃÂô */
add_action( 'wp_head', function() {
echo '<style id="wb-hero-unify-v21">';
echo 'body.wb-unify .wb-hero { padding-top:72px!important; padding-bottom:56px!important; min-height:280px!important; }';
echo 'body.wb-unify .wb-hero h1 { font-size:44px!important; font-weight:800!important; line-height:1.25!important; }';
echo 'body.wb-unify .wb-hero__tag { margin-bottom:20px!important; }';
/* èÃÂêÃ¥øæ hero çÃÂÃÂéáõéÃÂâïüÃÂ.bh-articleïüÃÂH1 ÃÂ¥ÃÂÃÂæÃÂÃÂ¥ÃÂ¥ÃÂð 44px */
echo 'body.wb-unify .bh-article > h1, body.wb-unify .bh-article > h1.bh-section__title { font-size:44px!important; font-weight:800!important; line-height:1.25!important; }';
echo '@media (max-width:1200px) { body.wb-unify .wb-hero h1, body.wb-unify .bh-article > h1 { font-size:32px!important; } }';
echo '</style>';
}, 20 );
/* ============================================================
* WB-Category-Hero Fix v24 (2026-08-01)
* äÿîÃ¥äÃÂïüÃÂÃÂ¥ÃÂÃÂçñû/Ã¥ýÃÂæáã/æàÃÂçÃÂþéáõ H1(.page-title) çÃÂÃÂâÃÂÃÂÃÂ¥ÃÂÃÂéÃÂÃÂéÃÂÃÂèÃÂÃÂâÃÂÃÂçüúéÃÂ÷
* âÃÂàæÃÂÿèýýæàÃÂéâÃÂçÃÂÃÂèãø <header> èâë header:not([class]):not([id]) èçÃÂÃÂ¥ÃÂÃÂèïïéÃÂÃÂèÃÂÃÂ
* âÃÂÃÂâÃÂàçÃÂöçúç display:none æÃÂöÃÂ¥ÃÂÃÂçúç H1 æÃÂàæóÃÂæÃÂþçäúïüÃÂÃ¥ÿÃÂ
éáûÃÂ¥ÃÂ
ÃÂæÃÂâÃ¥äÃÂèïÃÂ¥ header
* âÃÂá .page-title èâëÃÂ¥ÃÂ
èçëÃÂçûÃÂäøÃÂæà÷Ã¥üàdisplay:none/visibility:hidden/height:0 éÃÂÃÂèÃÂÃÂ
* æÃÂùæáÃÂïüÃÂäûÃ¥æÃÂÃÂéëÃÂçÃÂùÃ¥üÃÂæÃÂç(#maincontent) + wp_head éëÃÂäüÃÂÃÂ¥ÃÂ
ÃÂçúç(99) æÃÂâÃ¥äÃÂïüÃÂ
* Ã¥ùöÃ¥äÃÂÃÂ¥ÃÂûÃÂ¥ÃÂÃÂ
éáõ heroïüÃÂæ÷ñèÃÂÃÂÃÂ¥ÃÂ
èÃ¥îýæàÃÂéâÃÂÃ¥øæ + çÃÂýèÃÂò 44px/800 H1ïüÃÂÃ¥îÃÂçÃÂðæáÃÂæÃÂöçûÃÂäøÃÂãÃÂÃÂ
* èïôæÃÂÃÂïüÃÂæÃÂìÃÂ¥ÃÂýæÃÂðäøúéáöÃ¥ñÃÂæÃÂÃÂèýýïüÃÂäøÃÂäþÃÂèõÃÂÃÂ¥ÃÂÃÂÃÂ¥ÃÂòèáÃ¥äøÃÂÃÂ¥ÃÂÃÂïüÃÂéÃÂèÃÂ¥ÃÂÃÂÃÂ¥ÃÂàÃ¥õÃÂÃÂ¥ÃÂ¥ÃÂæóèÃÂ¥ÃÂÃÂèÿÃÂæÃÂÃÂèÃÂÃÂÃ¥äñæÃÂÃÂïüÃÂãÃÂÃÂ
* ============================================================ */
if ( ! function_exists( 'wb_category_hero_fix_css' ) ) {
function wb_category_hero_fix_css() {
if ( is_front_page() ) { return; }
if ( ! ( is_archive() || is_category() || is_tag() || is_tax() ) ) { return; }
?>
<style id="wb-cat-hero-v24">
/* âÃÂàæÃÂâÃ¥äÃÂæÃÂÿèýýÃÂ¥ÃÂÃÂçñûæàÃÂéâÃÂçÃÂàheaderïüÃÂèâë header:not([class]):not([id]) èïïéÃÂÃÂèÃÂÃÂïüÃÂ+ ÃÂ¥ÃÂ
èÃ¥îýæ÷ñèÃÂòÃ¥øæ */
body.wb-unify.archive #maincontent .web-frame > header,
body.wb-unify.category #maincontent .web-frame > header,
body.wb-unify.tag #maincontent .web-frame > header,
body.wb-unify.tax #maincontent .web-frame > header{
display:block!important;visibility:visible!important;opacity:1!important;
height:auto!important;max-height:none!important;min-height:0!important;overflow:visible!important;
width:100vw!important;max-width:100vw!important;
margin-left:calc(50% - 50vw)!important;margin-right:calc(50% - 50vw)!important;margin-top:0!important;margin-bottom:32px!important;
background:linear-gradient(135deg,#0A1628 0%,#14253f 100%)!important;
padding:60px calc(50vw - 600px) 48px!important;box-sizing:border-box!important;text-align:left!important;
}
@media(max-width:1248px){
body.wb-unify.archive #maincontent .web-frame > header,
body.wb-unify.category #maincontent .web-frame > header,
body.wb-unify.tag #maincontent .web-frame > header,
body.wb-unify.tax #maincontent .web-frame > header{padding-left:24px!important;padding-right:24px!important;}
}
/* âÃÂá æÃÂâÃ¥äà.page-title Ã¥ùöÃ¥ïùéýÃÂéæÃÂéáõ H1ïüÃÂ44px/800/çÃÂýèÃÂò */
body.wb-unify.archive #maincontent .page-title,
body.wb-unify.category #maincontent .page-title,
body.wb-unify.tag #maincontent .page-title,
body.wb-unify.tax #maincontent .page-title{
display:block!important;visibility:visible!important;opacity:1!important;
position:static!important;width:auto!important;height:auto!important;max-height:none!important;min-height:0!important;
overflow:visible!important;clip:auto!important;clip-path:none!important;
margin:0 0 12px!important;padding:0!important;
font-size:44px!important;font-weight:800!important;line-height:1.2!important;
color:#FAF8F5!important;text-align:left!important;letter-spacing:normal!important;
}
body.wb-unify.archive #maincontent .page-title span,
body.wb-unify.category #maincontent .page-title span,
body.wb-unify.tag #maincontent .page-title span,
body.wb-unify.tax #maincontent .page-title span{color:#C9A96E!important;}
@media(max-width:1200px){
body.wb-unify.archive #maincontent .page-title,
body.wb-unify.category #maincontent .page-title,
body.wb-unify.tag #maincontent .page-title,
body.wb-unify.tax #maincontent .page-title{font-size:32px!important;}
}
/* âÃÂâ ÃÂ¥ÃÂÃÂçñûæÃÂÃÂèÿðÃÂ¥ÃÂïæàÃÂéâÃÂïüÃÂæõÃÂ
èÃÂòïüÃÂæ÷ñÃ¥úÃÂÃÂ¥ÃÂïèïûïüà*/
body.wb-unify.archive #maincontent .taxonomy-description,
body.wb-unify.category #maincontent .taxonomy-description,
body.wb-unify.tag #maincontent .taxonomy-description,
body.wb-unify.tax #maincontent .taxonomy-description{
display:block!important;visibility:visible!important;height:auto!important;max-height:none!important;overflow:visible!important;
margin:0!important;color:rgba(250,248,245,.78)!important;font-size:16px!important;line-height:1.6!important;
}
body.wb-unify.archive #maincontent .taxonomy-description p,
body.wb-unify.category #maincontent .taxonomy-description p,
body.wb-unify.tag #maincontent .taxonomy-description p,
body.wb-unify.tax #maincontent .taxonomy-description p{margin:0!important;color:inherit!important;}
</style>
<?php
}
add_action( 'wp_head', 'wb_category_hero_fix_css', 99 );
}
/* ============================================================
* WB-UI-Consistency Patch v26 (2026-08-01)
* çûÃÂæÃÂÃÂæÃÂùæáÃÂïüÃÂÃÂ¥ÃÂè template_redirect priority 0 ÃÂ¥ÃÂïÃÂ¥ÃÂè ob_startïüÃÂ
* éÃÂÃÂèÿàregister_shutdown_function ÃÂ¥ÃÂè wbh_v3_takeover (priority 1) + exit
* äùÃÂÃÂ¥ÃÂÃÂæóèÃÂ¥ÃÂ
ÃÂ¥ .hero h1 éâÃÂèÃÂòäÿîæÃÂããÃÂÃÂèÿÃÂæÃÂáè÷ïÃ¥þÃÂèÃÂýçûÃÂèÿàWordfence æÃÂææÃÂêäøàtheme æÃÂÃ¥çîáãÃÂÃÂ
* ============================================================ */
if ( ! function_exists( 'wb_v26_home_hero_late_fix' ) ) {
function wb_v26_home_hero_late_fix() {
if ( ! is_front_page() ) { return; }
if ( isset($_GET['oldhome']) ) { return; }
ob_start();
register_shutdown_function(function(){
$html = ob_get_clean();
if ( $html === '' || $html === false ) { return; }
$fix = '<style id="wb-home-hero-fix-v26">'
. '.hero h1{color:#FAF8F5!important;-webkit-text-fill-color:#FAF8F5!important;}'
. '.hero h1 em{color:#C9A96E!important;-webkit-text-fill-color:#C9A96E!important;}'
. '</style>';
// äüÃÂÃÂ¥ÃÂ
ÃÂæóèÃÂ¥ÃÂ
ÃÂ¥ÃÂ¥ÃÂð </head> äùÃÂÃÂ¥ÃÂÃÂïüÃÂèÃÂÃ¥æÃÂþäøÃÂÃÂ¥ÃÂðÃÂ¥ÃÂÃÂèÿýÃÂ¥ÃÂàÃÂ¥ÃÂðæÃÂëÃ¥ðþ
$pos = strripos($html, '</head>');
if ( $pos !== false ) {
$html = substr($html, 0, $pos) . $fix . substr($html, $pos);
} else {
$html .= $fix;
}
echo $html;
});
}
add_action( 'template_redirect', 'wb_v26_home_hero_late_fix', 0 );
}
/* ============================================================
* WB-UI-Consistency Patch v26 (2026-08-01)
* çÃÂñäúÃÂéæÃÂéáõéÃÂÃÂçÃÂè WPCode snippet `wbh_v3_takeover` ÃÂ¥ÃÂè template_redirect priority 1
* çÃÂôæÃÂÃÂ¥ include home-v3.php Ã¥ùö exitïüÃÂæÃÂîéÃÂàwp_head/wp_footer/css éÃÂýèÿÃÂäøÃÂÃÂ¥ÃÂûãÃÂÃÂ
* ÃÂ¥ÃÂïäøÃÂçèóÃ¥æÃ¥ïüÃÂÃÂ¥ÃÂè functions.php äøàPHP èÃÂêæãà+ çÃÂôæÃÂÃ¥äÿîæÃÂù home-v3.phpïüÃÂ
* èîééæÃÂéáõèÃÂêèúëÃÂ¥ÃÂÃÂ
èÃÂàCSS äÿîæÃÂããÃÂÃÂ
* ============================================================ */
add_action( 'init', function() {
$f = WP_CONTENT_DIR . '/uploads/wb-home/home-v3.php';
if ( ! is_file( $f ) ) { return; }
$c = file_get_contents( $f );
if ( $c === false ) { return; }
if ( strpos( $c, 'wb-home-hero-fix-v26' ) !== false ) { return; }
$old = '.hero h1 em{font-style:normal;color:var(--gold)}';
$new = $old . "\n.hero h1{color:#FAF8F5!important;-webkit-text-fill-color:#FAF8F5!important;}";
if ( strpos( $c, $old ) === false ) { return; }
$c2 = str_replace( $old, $new, $c );
if ( $c2 === $c ) { return; }
@file_put_contents( $f, $c2 );
}, 1 );
/* ============================================================
* WB-UI-Consistency Patch v25 (2026-08-01)
* äÿîÃ¥äÃÂïüÃÂ
* âÃÂà404 éáõ / æÃÂÃÂçôâçûÃÂæÃÂÃÂéáõ H1 äøÃÂæÃÂãæÃÂÃÂÃ¥îùÃÂ¥ÃÂèæÃÂàhero æáÃÂæÃÂöïüÃÂÃ¥ïüèÃÂôæõÃÂ
èÃÂòæÃÂÃÂÃÂ¥ÃÂÃÂèÃÂýÃÂ¥ÃÂèçÃÂýÃ¥úÃÂäøÃÂäøÃÂÃÂ¥ÃÂïèïû
* âÃÂàÃ¥äÃÂÃÂ¥ÃÂûÃÂ¥ÃÂÃÂ
éáõ wb-heroïüÃÂæ÷ñèÃÂÃÂÃÂ¥ÃÂ
èÃ¥îý + çÃÂýèÃÂò 44px/800 H1 + æÃÂÃÂèÿðÃÂ¥ÃÂïæàÃÂéâÃÂ
* âÃÂá éæÃÂéáõ H1ïüÃÂsection.wb-heroïüÃÂ"ÃÂ¥ÃÂÃÂäúÃÂèþéæÃÂä"çÃÂÃÂæ÷ñèÃÂòÃÂ¥ÃÂ
óéÃÂîèïÃÂÃÂ¥ÃÂàÃÂ¥ÃÂèæ÷ñèÃÂòèÃÂÃÂæÃÂïäøÃÂäøÃÂÃÂ¥ÃÂïèïû
* âÃÂàÃÂ¥ÃÂ
óéÃÂîèïÃÂÃ¥üúÃÂ¥ÃÂö #C9A96EïüÃÂéÃÂÃÂïüÃÂïüÃÂäøÃÂéæÃÂéáõÃ¥üúèðÃÂèÃÂòäøÃÂèÃÂô
* âÃÂâ body.wb-unify éÃÂÃÂçÃÂèÃÂ¥ÃÂ
ÃÂÃ¥úÃÂïüÃÂ404/æÃÂÃÂçôâ/Ã¥ýÃÂæáãæàÃÂéâÃÂÃ¥îùÃÂ¥ÃÂèèõÃÂäúàhero Ã¥äÃÂèçÃÂ
* äüÃÂÃÂ¥ÃÂ
ÃÂçúçïüÃÂwp_head 99ïüÃÂæÃÂÃÂéëÃÂïüÃÂ
* ============================================================ */
if ( ! function_exists( 'wb_404_search_hero_fix' ) ) {
function wb_404_search_hero_fix() {
if ( is_front_page() ) { return; }
?>
<style id="wb-404-search-hero-v25">
/* âÃÂà404 äøÃÂæÃÂÃÂçôâçûÃÂæÃÂÃÂéáõïüÃÂÃÂ¥ÃÂÃÂ
Ã¥ñà.page-content/.entry-content æÃÂùéÃÂàäøú wb-hero */
body.wb-unify.error404 .page-content,
body.wb-unify.search .page-content,
body.wb-unify.search .entry-content,
body.wb-unify.search-results .entry-content{
background:linear-gradient(135deg,#0A1628 0%,#14253f 100%)!important;
color:#FAF8F5!important;
}
/* 404 H1ïüÃÂpage-content > h1 */
body.wb-unify.error404 .page-content h1,
body.wb-unify.error404 main h1{
display:block!important;visibility:visible!important;opacity:1!important;
position:static!important;width:auto!important;height:auto!important;
max-height:none!important;min-height:0!important;overflow:visible!important;
clip:auto!important;clip-path:none!important;
color:#FAF8F5!important;
font-size:44px!important;font-weight:800!important;line-height:1.2!important;
margin:0 0 12px!important;
}
/* æÃÂÃÂçôâéáõ H1ïüÃÂh1.entry-titleïüÃÂèâë wb-ui-unify-patch çÃÂàh1 ~ h1 éÃÂÃÂèÃÂÃÂïüà*/
/* çÃÂè id éÃÂÃÂæÃÂéÃÂ¥ÃÂèæÃÂÃÂÃ¥ñÃÂçúçæÃÂÃÂæ÷ñçÃÂÃÂæÃÂùÃ¥üÃÂæÃÂÃÂÃÂ¥ÃÂðæÃÂÃÂéëÃÂäüÃÂÃÂ¥ÃÂ
ÃÂçúçïüÃÂÃÂ¥ÃÂàÃÂ¥ÃÂàÃÂ¥ÃÂð 0,0,3,0ïüà*/
body.wb-unify.search main#maincontent h1.entry-title,
body.wb-unify.search main#maincontent .entry-title,
body.wb-unify.search-results main#maincontent h1.entry-title,
body.wb-unify.search main h1.entry-title{
display:block!important;visibility:visible!important;opacity:1!important;
position:static!important;left:auto!important;
width:auto!important;height:auto!important;
max-height:none!important;min-height:0!important;overflow:visible!important;
clip:auto!important;clip-path:none!important;
color:#FAF8F5!important;
font-size:44px!important;font-weight:800!important;line-height:1.2!important;
margin:0 0 12px!important;
padding:0!important;border:0!important;
}
/* æÃÂÃÂæÃÂìæÃÂÃÂèÿð */
body.wb-unify.error404 .page-content p,
body.wb-unify.search .page-content p,
body.wb-unify.search .entry-summary,
body.wb-unify.search .page-header p{
color:rgba(250,248,245,.82)!important;font-size:16px!important;line-height:1.7!important;
}
@media(max-width:1200px){
body.wb-unify.error404 .page-content h1,
body.wb-unify.error404 main h1,
body.wb-unify.search main h1.entry-title,
body.wb-unify.search-results main#maincontent h1.entry-title{font-size:32px!important;}
}
/* âÃÂá ÃÂ¥ÃÂÃÂ
éáõ hero ÃÂ¥ÃÂúÃÂ¥ÃÂÃÂïüÃÂ404 / æÃÂÃÂçôâïüÃÂÃÂ¥ÃÂ
ÃÂÃ¥úÃÂïüÃÂçûà.page-content Ã¥îùÃÂ¥ÃÂèÃÂ¥ÃÂàpadding Ã¥ýâæÃÂÃÂæ÷ñèÃÂÃÂÃ¥øæ */
body.wb-unify.error404 .page-content,
body.wb-unify.search .page-content{
padding:48px calc(50vw - 600px) 56px!important;color:#FAF8F5!important;
margin-bottom:32px!important;
box-sizing:border-box!important;
}
@media(max-width:1248px){
body.wb-unify.error404 .page-content,
body.wb-unify.search .page-content{padding-left:24px!important;padding-right:24px!important;}
}
/* âÃÂâ æÃÂÃÂçôâéáõïüÃÂæÃÂà.middle-align.container > header Ã¥îùÃÂ¥ÃÂèäùÃÂÃÂ¥ÃÂàæ÷ñèÃÂÃÂÃ¥øæïüÃÂÃÂ¥ÃÂêæÃÂÃÂéÃÂÃÂéÃÂâÃÂ¥ÃÂêæÃÂÃÂçéú headerïüà*/
body.wb-unify.search .middle-align.container > header,
body.wb-unify.search-results .page-header{
background:linear-gradient(135deg,#0A1628 0%,#14253f 100%)!important;
color:#FAF8F5!important;
padding:60px calc(50vw - 600px) 48px!important;
margin-left:calc(50% - 50vw)!important;margin-right:calc(50% - 50vw)!important;
margin-bottom:32px!important;
}
body.wb-unify.search .middle-align.container > header *,
body.wb-unify.search-results .page-header *{color:#FAF8F5!important;}
</style>
<script id="wb-404-search-hero-js-v25">
/* ÃÂ¥ÃÂ
ÃÂÃ¥úÃÂïüÃÂçÃÂôæÃÂÃ¥æøÃÂ
æÃÂÃÂæÃÂÃÂçôâéáõ H1 äøÃÂéÃÂâçÃÂÃÂéÃÂÃÂèÃÂÃÂæà÷Ã¥üÃÂïüÃÂéÃÂÿÃÂ¥ÃÂ
ÃÂèâë wb-ui-unify-patch çÃÂàh1~h1 èçÃÂÃÂ¥ÃÂÃÂÃÂ¥ÃÂÃÂæÃÂû */
(function(){
function fixH1(el){
if(!el) return;
el.style.setProperty('display','block','important');
el.style.setProperty('visibility','visible','important');
el.style.setProperty('opacity','1','important');
el.style.setProperty('position','static','important');
el.style.setProperty('left','auto','important');
el.style.setProperty('width','auto','important');
el.style.setProperty('height','auto','important');
el.style.setProperty('max-height','none','important');
el.style.setProperty('min-height','0','important');
el.style.setProperty('overflow','visible','important');
el.style.setProperty('clip','auto','important');
el.style.setProperty('clip-path','none','important');
el.style.setProperty('color','#FAF8F5','important');
el.style.setProperty('font-size','44px','important');
el.style.setProperty('font-weight','800','important');
el.style.setProperty('line-height','1.2','important');
el.style.margin='0 0 12px';
el.style.padding='0';
el.style.border='0';
}
function run(){
var body=document.body;
if(!body||!body.classList.contains('wb-unify')) return;
if(body.classList.contains('search')||body.classList.contains('search-results')){
fixH1(document.querySelector('main#maincontent h1.entry-title'));
fixH1(document.querySelector('h1.entry-title'));
// ÃÂ¥ÃÂÃÂ
èãùæ÷ñèÃÂàhero Ã¥îùÃÂ¥ÃÂè
var wrap=document.querySelector('main#maincontent > .middle-align.container');
if(wrap){
wrap.style.setProperty('background','linear-gradient(135deg,#0A1628 0%,#14253f 100%)','important');
wrap.style.setProperty('color','#FAF8F5','important');
wrap.style.setProperty('padding','48px calc(50vw - 600px) 56px','important');
wrap.style.setProperty('margin-bottom','32px','important');
}
}else if(body.classList.contains('error404')){
fixH1(document.querySelector('.page-content h1'));
fixH1(document.querySelector('main h1'));
var pc=document.querySelector('.page-content');
if(pc){
pc.style.setProperty('background','linear-gradient(135deg,#0A1628 0%,#14253f 100%)','important');
pc.style.setProperty('color','#FAF8F5','important');
pc.style.setProperty('padding','48px calc(50vw - 600px) 56px','important');
}
}
}
if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',run);}
else{run();}
// Ã¥ûöèÿÃÂÃÂ¥ÃÂÃÂæÃÂçèáÃÂäøÃÂæìáïüÃÂÃ¥úÃÂÃ¥ïùäøûéâàJS ÃÂ¥ÃÂÃÂæøòæÃÂÃÂ
setTimeout(run,500);
setTimeout(run,1500);
})();
</script>
<?php
}
add_action( 'wp_head', 'wb_404_search_hero_fix', 99 );
}
/* âÃÂá éæÃÂéáõ H1ïüÃÂÃÂ¥ÃÂ
óéÃÂîèïÃÂÃ¥üúÃÂ¥ÃÂöéÃÂÃÂèÃÂòïüÃÂéÃÂÿÃÂ¥ÃÂ
ÃÂÃÂ¥ÃÂÃÂèÃÂòÃÂ¥ÃÂàÃÂ¥ÃÂÃÂäøÃÂÃÂ¥ÃÂïèïûïüà*/
if ( ! function_exists( 'wb_home_h1_keyword_fix' ) ) {
function wb_home_h1_keyword_fix() {
if ( ! is_front_page() ) { return; }
?>
<style id="wb-home-h1-kw-v25">
/* éæÃÂéáõ H1 Ã¥üúÃÂ¥ÃÂöçÃÂýèÃÂòïüÃÂæÃÂàèîúæÃÂÃ¥æúÃÂïüÃÂïüÃÂsection.hero æÃÂï home-v3.php çÃÂÃÂçÃÂÃÂÃ¥îÃÂÃ¥îùÃÂ¥ÃÂè */
/* æóèæÃÂÃÂïüÃÂbody ÃÂ¥ÃÂêæÃÂàwb-unifyïüÃÂæÃÂà.home çñûïüÃÂæÃÂÃÂäûÃ¥äøÃÂÃÂ¥ÃÂÃÂÃ¥øæ .home */
body.wb-unify section.hero h1,
body.wb-unify .hero h1,
body.wb-unify .hero__in h1,
body.wb-unify .hero__title,
body.wb-unify .wb-hero h1,
body.wb-unify .wb-hero__title{
color:#FAF8F5!important;
-webkit-text-fill-color:#FAF8F5!important;
text-shadow:0 2px 12px rgba(10,22,40,.35)!important;
}
/* ÃÂ¥ÃÂ
óéÃÂîèïÃÂéÃÂÃÂèÃÂòïüÃÂstrong/b/em/.kw/span.hl */
body.wb-unify section.hero h1 strong,
body.wb-unify section.hero h1 b,
body.wb-unify section.hero h1 em,
body.wb-unify section.hero h1 .kw,
body.wb-unify section.hero h1 span.hl,
body.wb-unify section.hero h1 span.gold{
color:#C9A96E!important;
-webkit-text-fill-color:#C9A96E!important;
font-style:normal!important;font-weight:800!important;
}
/* ÃÂ¥ÃÂ
ÃÂÃ¥úÃÂïüÃÂæøÃÂ
æÃÂÃÂäûûäýàinline æîÃÂçÃÂÃÂçÃÂÃÂæ÷ñèÃÂòæà÷Ã¥üà*/
body.wb-unify section.hero h1[style*="rgb(10"]{
color:#FAF8F5!important;
}
</style>
<script id="wb-home-h1-clean-v25">
(function(){
if(!document.body.classList.contains('wb-unify')) return;
var h=document.querySelector('section.hero h1, .hero h1, .wb-hero h1');
if(!h) return;
// Ã¥üúÃÂ¥ÃÂö inline style èæÃÂçÃÂÃÂïüÃÂéâÃÂèÃÂò + ÃÂ¥ÃÂ
óéÃÂîèïà.kw ÃÂ¥ÃÂÃÂ
èãù
h.style.setProperty('color','#FAF8F5','important');
h.style.setProperty('-webkit-text-fill-color','#FAF8F5','important');
h.style.textShadow='0 2px 12px rgba(10,22,40,.35)';
// ÃÂ¥ÃÂ
óéÃÂîèïÃÂéÃÂÃÂèÃÂòÃÂ¥ÃÂÃÂ
èãù
if(/ÃÂ¥ÃÂÃÂäúÃÂèþéæÃÂä/.test(h.innerHTML) && !h.querySelector('.kw')){
h.innerHTML=h.innerHTML.replace(/(ÃÂ¥ÃÂÃÂäúÃÂèþéæÃÂä)/g,'<em class="kw">$1</em>');
var ems=h.querySelectorAll('em.kw');
for(var i=0;i<ems.length;i++){
ems[i].style.setProperty('color','#C9A96E','important');
ems[i].style.setProperty('-webkit-text-fill-color','#C9A96E','important');
ems[i].style.fontStyle='normal';
ems[i].style.fontWeight='800';
}
}
})();
</script>
<?php
}
add_action( 'wp_head', 'wb_home_h1_keyword_fix', 99 );
}
/* ============================================================
* WB-UI-Consistency Patch v27 (2026-08-01)
* éæÃÂéáõ home-v3.php çÃÂñ WPCode çÃÂÃÂæîõ WB-HomeV3-TakeOver ÃÂ¥ÃÂè
* template_redirect priority 1 çÃÂôæÃÂÃÂ¥ include + exitïüÃÂ
* ÃÂ¥ÃÂàæÃÂä wp_head / wp_footer / enqueue æóèÃÂ¥ÃÂ
Ã¥çÃÂàCSS éÃÂýèÿÃÂäøÃÂÃÂ¥ÃÂûãÃÂÃÂ
* ÃÂ¥ÃÂïäøÃÂçèóÃ¥æÃ¥æÃÂùæáÃÂïüÃÂçÃÂôæÃÂÃ¥æÃÂùÃÂ¥ÃÂàhome-v3.phpïüÃÂÃÂ¥ÃÂèÃÂ¥ÃÂ
öÃÂ¥ÃÂÃÂ
èÃÂà<style> æÃÂëÃ¥ðþæóèÃÂ¥ÃÂ
ÃÂ¥
* .hero h1 éâÃÂèÃÂòäÿîæÃÂãïüÃÂäýÿãÃÂÃÂÃÂ¥ÃÂÃÂäúÃÂèþéæÃÂäãÃÂÃÂçÃÂÃÂÃÂ¥ÃÂ
óéÃÂîèïÃÂäøÃÂæÃÂôèáÃÂÃÂ¥ÃÂèæ÷ñèÃÂÃÂÃ¥úÃÂäøÃÂÃÂ¥ÃÂïèïûãÃÂÃÂ
* ÃÂ¥ÃÂææÃÂÃÂäþà?wbpdiag=1 èïÃÂæÃÂÃÂçëïçÃÂùïüÃÂçáîèîäæÃÂÃÂäûöÃÂ¥ÃÂïÃÂ¥ÃÂÃÂæÃÂçäøÃÂæóèÃÂ¥ÃÂ
Ã¥éÃÂÃÂçÃÂùãÃÂÃÂ
* ============================================================ */
/* ============================================================
* WB-UI-Consistency Patch v27 (2026-08-01)
* éæÃÂéáõ home-v3.php çÃÂñ WPCode çÃÂÃÂæîõ WB-HomeV3-TakeOver ÃÂ¥ÃÂè
* template_redirect priority 1 çÃÂôæÃÂÃÂ¥ include + exitïüÃÂ
* æÃÂÃÂ
wp_head / wp_footer / enqueue æóèÃÂ¥ÃÂ
Ã¥çÃÂàCSS ÃÂ¥ÃÂÃÂæÃÂàæóÃÂèÿÃÂÃÂ¥ÃÂ
Ã¥ãÃÂÃÂ
* ÃÂ¥ÃÂïäøÃÂçèóÃ¥æÃ¥æÃÂùæáÃÂïüÃÂçÃÂôæÃÂÃ¥æÃÂùÃÂ¥ÃÂàhome-v3.phpïüÃÂÃÂ¥ÃÂèÃÂ¥ÃÂ
öÃÂ¥ÃÂÃÂ
èÃÂà<style> æÃÂëÃ¥ðþæóèÃÂ¥ÃÂ
ÃÂ¥
* .hero h1 éâÃÂèÃÂòäÿîæÃÂãïüÃÂäýÿãÃÂÃÂÃÂ¥ÃÂÃÂäúÃÂèþéæÃÂäãÃÂÃÂçÃÂÃÂÃÂ¥ÃÂ
óéÃÂîèïÃÂäøÃÂæÃÂôèáÃÂÃÂ¥ÃÂèæ÷ñèÃÂÃÂÃ¥úÃÂäøÃÂÃÂ¥ÃÂïèïûãÃÂÃÂ
* ïüÃÂÃ¥÷òççûéÃÂäÃÂ¥ÃÂ
èéÃÂèèðÃÂèïÃÂ/èïÃÂæÃÂÃÂçëïçÃÂùïüÃÂéÃÂÿÃÂ¥ÃÂ
ÃÂæÃÂÃÂæÃÂÃÂäÿáæÃÂïÃ¥äÃÂæóÃÂãÃÂÃÂïüÃÂ
* ============================================================ */
add_action( 'init', function () {
// çÃÂÃÂæÃÂãäÿîæÃÂãïüÃÂæÃÂà.hero h1 éâÃÂèÃÂòÃÂ¥ÃÂÃÂèÿàhome-v3.phpïüÃÂÃ¥ùÃÂçÃÂÃÂãÃÂÃÂæÃÂàèðÃÂèïÃÂèþÃÂÃÂ¥ÃÂúïüÃÂ
$f = WP_CONTENT_DIR . '/uploads/wb-home/home-v3.php';
if ( ! is_file( $f ) ) { return; }
$c = @file_get_contents( $f );
if ( $c === false ) { return; }
if ( strpos( $c, 'wb-hero-color-fix' ) !== false ) { return; } // Ã¥÷òæóèÃÂ¥ÃÂ
Ã¥ïüÃÂè÷óèÿÃÂ
if ( strpos( $c, '</style>' ) === false ) { return; } // æÃÂàéÃÂÃÂçÃÂùïüÃÂè÷óèÿÃÂ
$fix = "\n/* WB hero H1 éâÃÂèÃÂòäÿîæÃÂã wb-hero-color-fix */\n"
. ".hero h1{color:#FAF8F5!important;-webkit-text-fill-color:#FAF8F5!important;}\n"
. ".hero h1 em{color:#C9A96E!important;-webkit-text-fill-color:#C9A96E!important;}\n";
$c2 = str_replace( '</style>', $fix . '</style>', $c );
if ( $c2 === $c ) { return; }
@file_put_contents( $f, $c2 );
}, 1 );
/* WB v27.8 âÃÂàÃ¥üúÃÂ¥ÃÂöéæÃÂéáõ include ÃÂ¥ÃÂÃÂäýÿ home-v3.php çÃÂàOPcache æÃÂáçÃÂîÃ¥äñæÃÂÃÂïüÃÂ
* çáîäÿàinclude éÃÂÃÂæÃÂðçüÃÂèïÃÂèÃÂêÃ¥÷òæÃÂÃÂèáÃ¥äøÃÂçÃÂÃÂçãÃÂçÃÂÃÂæÃÂÃÂäûöãÃÂÃÂæÃÂàèðÃÂèïÃÂèþÃÂÃÂ¥ÃÂúãÃÂà*/
add_action( 'template_redirect', function () {
if ( isset( $_GET['oldhome'] ) ) { return; }
if ( ! is_front_page() ) { return; }
$f = WP_CONTENT_DIR . '/uploads/wb-home/home-v3.php';
if ( is_file( $f ) && function_exists( 'opcache_invalidate' ) ) {
@opcache_invalidate( $f, true );
}
clearstatcache( true );
}, 0 );
/* ============================================================
* WB-Button-Consistency Fix (2026-08-01)
* äÿîÃ¥äÃÂÃÂ¥ÃÂÃÂ
éáõ CTA æÃÂÃÂéÃÂîèâë wb-design-system FIX-02 éÃÂÃÂçýîèçÃÂÃÂ¥ÃÂÃÂÃÂ¥ÃÂÃÂÃ¥ùóçÃÂÃÂéÃÂîéâÃÂãÃÂÃÂ
* FIX-02: a:not(.btn):not(.button):not([type="submit"]):not([type="button"])
* :not(.wb-cf-tel):not(.wb-cf-wx):not(.wp-block-button__link)
* ïüÃÂçÃÂùÃ¥üÃÂæÃÂç 0,7,1 äøà!importantïüÃÂâÃÂàbackground:transparent;padding:0;border:none;
* border-radius:0;display:inline;box-shadow:none ... æÃÂà.wb-btn ÃÂ¥ÃÂÃÂæÃÂÃÂèãøæÃÂÃÂæÃÂìéÃÂþæÃÂÃ¥ãÃÂÃÂ
* æÃÂìèáÃ¥äøÃÂçÃÂèæÃÂôéëÃÂçÃÂùÃ¥üÃÂæÃÂç(0,10,2)éÃÂÃÂæÃÂðÃ¥ãðæÃÂÃÂæÃÂÃÂéÃÂîÃ¥äÃÂèçÃÂïüÃÂèæÃÂçÃÂÃÂèïÃ¥éÃÂÃÂçýîãÃÂÃÂ
* äøÃÂæÃÂùÃÂ¥ÃÂèäûûäýÃÂéáõéÃÂâÃÂ¥ÃÂÃÂ
Ã¥îùäøÃÂÃÂ¥ÃÂÃÂèÃÂýæÃÂÃÂÃÂ¥ÃÂÃÂãÃÂÃÂ
* ============================================================ */
if ( ! function_exists( 'wb_btn_shape_fix_css' ) ) {
function wb_btn_shape_fix_css() {
if ( is_front_page() ) { return; }
?>
<style id="wb-btn-shape-fix">
/* ÃÂ¥ÃÂúçáÃÂæÃÂÃÂéÃÂîÃ¥ýâçÃÂöïüÃÂèæÃÂçÃÂàFIX-02 éÃÂÃÂçýîïüÃÂçÃÂùÃ¥üÃÂæÃÂç 0,10,2 > 0,7,1ïüà*/
body.wb-unify a.wb-btn:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8),
body.wb-unify a.bh-btn:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8){
display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;
border-radius:8px!important;padding:12px 22px!important;
font:600 16px/1 "PingFang SC","Microsoft YaHei",sans-serif!important;cursor:pointer!important;
text-decoration:none!important;border:1px solid transparent!important;
box-shadow:0 1px 2px rgba(139,26,26,.18),0 6px 18px rgba(139,26,26,.22)!important;
transition:all .25s ease-out!important;white-space:nowrap!important;
}
/* éÃÂÃÂèÃÂòÃ¥îÃÂÃ¥ÿÃÂæÃÂÃÂéÃÂî */
body.wb-unify a.wb-btn--gold:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8),
body.wb-unify a.bh-btn--gold:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8){
background-color:#C9A96E!important;color:#0A1628!important;border-color:#C9A96E!important;
}
/* éÃÂÃÂèÃÂòæÃÂÃÂèþùæÃÂÃÂéÃÂî */
body.wb-unify a.wb-btn--ghost:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8),
body.wb-unify a.bh-btn--ghost:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8){
background-color:transparent!important;color:#C9A96E!important;border:1px solid #C9A96E!important;
}
/* hoverïüÃÂéÃÂÃÂÃ¥îÃÂæÃÂÃÂäúîïüÃÂéÃÂÃÂæÃÂÃÂèþùÃ¥áëÃÂ¥ÃÂ
ÃÂ
*/
body.wb-unify a.wb-btn--gold:hover,body.wb-unify a.bh-btn--gold:hover{background-color:#D8BC85!important;color:#0A1628!important;}
body.wb-unify a.wb-btn--ghost:hover,body.wb-unify a.bh-btn--ghost:hover{background-color:#C9A96E!important;color:#0A1628!important;}
</style>
<?php
}
add_action( 'wp_head', 'wb_btn_shape_fix_css', 99 );
}
/* æÃÂãæÃÂÃÂÃÂ¥ÃÂúÃÂ¥ÃÂÃÂÃÂ¥ÃÂÃÂÃÂ¥ÃÂ÷Ã¥ïùéýÃÂéæÃÂéáõïüÃÂäÿîæÃÂãäøûéâàbody{font-size:14px} çÃÂÃÂèæÃÂçÃÂÃÂïüÃÂçÃÂùÃ¥üÃÂæÃÂç 0,2,1 > 0,0,1ïüà*/
if ( ! function_exists( 'wb_body_font_fix' ) ) {
function wb_body_font_fix() {
if ( is_front_page() ) { return; }
echo '<style id="wb-body-font-fix">body.wb-unify{font-size:16px!important;line-height:1.75!important;}</style>';
}
add_action( 'wp_head', 'wb_body_font_fix', 99 );
}
/* ============================================================
* WB-Hero-H1-Color Normalize (2026-08-01)
* äøûéâàJS äûÃÂ¥ÃÂ¥ÃÂÃÂ
èÃÂà!important æÃÂÃÂÃÂ¥ÃÂÃÂ
éáõ .wb-hero h1 èîþäøú #F5EFE4ïüÃÂçñóçÃÂýïüÃÂïüÃÂ
* Ã¥äÃÂéÃÂè CSS æÃÂàæóÃÂèæÃÂçÃÂÃÂÃÂ¥ÃÂÃÂ
èÃÂà!importantïüÃÂæÃÂÃÂ
çÃÂè load ÃÂ¥ÃÂàJS èæÃÂçÃÂÃÂäøú #FAF8F5ïüÃÂçÃÂýïüÃÂÃ¥ïùéýÃÂéæÃÂéáõïüÃÂãÃÂÃÂ
* äøÃÂæÃÂùÃÂ¥ÃÂèäûûäýÃÂéáõéÃÂâÃÂ¥ÃÂÃÂ
Ã¥îùäøÃÂÃÂ¥ÃÂÃÂèÃÂýæÃÂÃÂÃÂ¥ÃÂÃÂãÃÂÃÂ
* ============================================================ */
if ( ! function_exists( 'wb_hero_h1_color_normalize' ) ) {
function wb_hero_h1_color_normalize() {
if ( is_front_page() ) { return; }
?>
<script id="wb-hero-h1-color">
window.addEventListener('load', function(){
function fix(){
document.querySelectorAll('body.wb-unify .wb-hero h1, body.wb-unify .hero h1').forEach(function(h){
h.style.setProperty('color','#FAF8F5','important');
h.style.setProperty('-webkit-text-fill-color','#FAF8F5','important');
h.querySelectorAll('em,strong').forEach(function(e){
e.style.setProperty('color','#C9A96E','important');
e.style.setProperty('-webkit-text-fill-color','#C9A96E','important');
});
});
}
fix();
setTimeout(fix, 60);
});
</script>
<?php
}
add_action( 'wp_footer', 'wb_hero_h1_color_normalize', 99 );
}
/* ============================================================
* WB-Final-UI-Consistency Fix v3.1 (2026-08-01)
* éÃÂîéâÃÂïüÃÂèÃÂêÃ¥îÃÂäùàCSS (WB-UI-Unify v2.1) æÃÂÃÂÃÂ¥ÃÂ
èçëÃÂæÃÂãæÃÂÃÂÃÂ¥ÃÂúÃ¥ýÃÂæÃÂÃÂæ÷ñèÃÂÃÂÃ¥úÃÂæÃÂÃÂèÃÂòïüÃÂ
* äøàwb-unify-php-override ÃÂ¥ÃÂòçêÃÂïüÃÂÃ¥ïüèÃÂôÃÂ¥ÃÂÃÂ
éáõ H1/æÃÂãæÃÂÃÂÃÂ¥ÃÂèæõÃÂ
èÃÂòÃÂ¥ÃÂúäøÃÂÃÂ¥ÃÂïèïûãÃÂÃÂ
* çÃÂîæàÃÂïüÃÂäûÃ¥éæÃÂéáõäøúÃÂ¥ÃÂúÃÂ¥ÃÂÃÂïüÃÂçûÃÂäøÃÂÃÂ¥ÃÂ
èçëÃÂÃÂ¥ÃÂÃÂ
éáõäøûéâÃÂ/UIãÃÂÃÂ
* ÃÂ÷ æÃÂãæÃÂÃÂÃÂ¥ÃÂúïüÃÂçñóçÃÂýÃ¥úà#FAF8F5 + æ÷ñèÃÂòæÃÂãæÃÂà#2D3436
* ÃÂ÷ Hero ÃÂ¥ÃÂúïüÃÂæ÷ñèÃÂÃÂÃ¥úà+ çÃÂý/éÃÂÃÂèÃÂòæÃÂÃÂÃÂ¥ÃÂÃÂ
* ÃÂ÷ äøÃÂæÃÂùÃÂ¥ÃÂèäûûäýÃÂéáõéÃÂâÃÂ¥ÃÂÃÂ
Ã¥îùäøÃÂÃÂ¥ÃÂÃÂèÃÂýæÃÂÃÂÃÂ¥ÃÂÃÂ
* äüÃÂÃÂ¥ÃÂ
ÃÂçúçïüÃÂwp_head 100ïüÃÂèæÃÂçÃÂàwp-custom-css äøÃÂÃÂ¥ÃÂÃÂÃÂ¥ÃÂòèáÃ¥äøÃÂãÃÂÃÂ
* ============================================================ */
if ( ! function_exists( 'wb_final_ui_consistency_fix' ) ) {
function wb_final_ui_consistency_fix() {
if ( is_front_page() ) { return; }
?>
<style id="wb-final-ui-fix-v3">
/* 1) æÃÂãæÃÂÃÂÃ¥îùÃÂ¥ÃÂèæÃÂâÃ¥äÃÂéæÃÂéáõéÃÂ
ÃÂèÃÂò */
body.wb-unify main,
body.wb-unify .content-vw,
body.wb-unify .entry-content,
body.wb-unify .middle-align,
body.wb-unify .site-main,
body.wb-unify #primary,
body.wb-unify .content-area {
background-color: #FAF8F5 !important;
background-image: none !important;
color: #2D3436 !important;
}
/* 2) æÃÂãæÃÂÃÂÃÂ¥ÃÂúæÃÂÃÂæÃÂÃÂæàÃÂéâÃÂæÃÂâÃ¥äÃÂæ÷ñèÃÂÃÂïüÃÂéëÃÂçÃÂùÃ¥üÃÂæÃÂçïüÃÂ0,2,1 ~ 0,3,1ïüà*/
body.wb-unify .entry-content h1,
body.wb-unify .entry-content h2,
body.wb-unify .entry-content h3,
body.wb-unify .entry-content h4,
body.wb-unify .entry-content h5,
body.wb-unify .entry-content h6,
body.wb-unify .bh-article h1,
body.wb-unify .bh-article h2,
body.wb-unify .bh-article h3,
body.wb-unify .bh-article h4,
body.wb-unify .bh-article h5,
body.wb-unify .bh-article h6,
body.wb-unify .wb-services-intro h1,
body.wb-unify .wb-services-intro h2,
body.wb-unify .wb-page-intro h1,
body.wb-unify .wb-page-intro h2,
body.wb-unify .wb-services-list h1,
body.wb-unify .wb-services-list h2,
body.wb-unify .wb-services-list h3 {
color: #0A1628 !important;
}
/* 3) æÃÂãæÃÂÃÂÃÂ¥ÃÂúæîõèÃÂýãÃÂÃÂÃÂ¥ÃÂÃÂèáèãÃÂÃÂæÃÂÃÂèÿðæÃÂâÃ¥äÃÂæ÷ñèÃÂò */
body.wb-unify .entry-content p,
body.wb-unify .entry-content li,
body.wb-unify .entry-content dd,
body.wb-unify .entry-content dt,
body.wb-unify .entry-content blockquote,
body.wb-unify .entry-content span,
body.wb-unify .bh-article p,
body.wb-unify .bh-article li,
body.wb-unify .bh-article dd,
body.wb-unify .bh-article dt,
body.wb-unify .bh-article blockquote,
body.wb-unify .bh-article span,
body.wb-unify .wb-services-intro p,
body.wb-unify .wb-services-intro li,
body.wb-unify .wb-services-intro span,
body.wb-unify .wb-page-intro p,
body.wb-unify .wb-page-intro li,
body.wb-unify .wb-page-intro span,
body.wb-unify .wb-services-list li,
body.wb-unify .wb-services-list p {
color: #2D3436 !important;
}
/* 4) Hero ÃÂ¥ÃÂúÃÂ¥ÃÂ
ÃÂÃ¥úÃÂïüÃÂçÃÂý/éÃÂÃÂÃÂ¥ÃÂà*/
body.wb-unify .wb-hero,
body.wb-unify .wb-hero__in {
color: #F5EFE4 !important;
}
body.wb-unify .wb-hero h1,
body.wb-unify .wb-hero h2,
body.wb-unify .wb-hero h3,
body.wb-unify .wb-hero p,
body.wb-unify .wb-hero a:not(.wb-btn):not(.bh-btn):not(.btn),
body.wb-unify .wb-hero span {
color: #FAF8F5 !important;
}
/* 4b) 404 / æÃÂÃÂçôâéáõïüÃÂäÿÃÂçÃÂÃÂæ÷ñèÃÂàhero Ã¥øæïüÃÂçÃÂýÃÂ¥ÃÂÃÂïüÃÂäøÃÂèâëæÃÂãæÃÂÃÂæõÃÂ
èÃÂòèçÃÂÃÂ¥ÃÂÃÂèæÃÂçÃÂÃÂïüà*/
body.error404.wb-unify .page-content,
body.error404.wb-unify main .page-content {
background-color: #0A1628 !important;
background-image: linear-gradient(135deg, #0A1628 0%, #14253F 60%, #0A1628 100%) !important;
color: #FAF8F5 !important;
}
body.error404.wb-unify .page-content h1,
body.error404.wb-unify .page-content .wb-404 h1,
body.error404.wb-unify .page-content .entry-title {
color: #FAF8F5 !important;
}
body.error404.wb-unify .page-content p,
body.error404.wb-unify .page-content a {
color: #F5EFE4 !important;
}
/* 5) éÃÂþæÃÂÃ¥ïüÃÂæÃÂãæÃÂÃÂÃÂ¥ÃÂúæ÷ñèÃÂÃÂãÃÂÃÂhover éÃÂÃÂèÃÂòïüÃÂHero ÃÂ¥ÃÂúéÃÂÃÂèÃÂò */
body.wb-unify .entry-content a:not(.wb-btn):not(.bh-btn):not(.btn),
body.wb-unify .bh-article a:not(.wb-btn):not(.bh-btn):not(.btn),
body.wb-unify .wb-services-intro a:not(.wb-btn):not(.bh-btn):not(.btn),
body.wb-unify .wb-page-intro a:not(.wb-btn):not(.bh-btn):not(.btn) {
color: #1a5490 !important;
}
body.wb-unify .entry-content a:hover,
body.wb-unify .bh-article a:hover,
body.wb-unify .wb-services-intro a:hover,
body.wb-unify .wb-page-intro a:hover {
color: #C9A96E !important;
}
/* 6) èáèÃÂ¥ÃÂÃÂæÃÂçäûöÃÂ¥ÃÂèæÃÂãæÃÂÃÂÃÂ¥ÃÂúéÃÂÃÂéÃÂ
ÃÂæõÃÂ
èÃÂòèÃÂÃÂæÃÂï */
body.wb-unify .entry-content input,
body.wb-unify .entry-content textarea,
body.wb-unify .entry-content select,
body.wb-unify .wb-page-intro input,
body.wb-unify .wb-page-intro textarea,
body.wb-unify .wb-page-intro select {
background-color: #fff !important;
border-color: rgba(10,22,40,0.25) !important;
color: #2D3436 !important;
}
body.wb-unify .entry-content input::placeholder,
body.wb-unify .entry-content textarea::placeholder {
color: rgba(45,52,54,0.55) !important;
}
/* 7) éÃÂâÃÂ¥ÃÂÃÂ
Ã¥ñà*/
body.wb-unify .bradcrumbs,
body.wb-unify .breadcrumbs,
body.wb-unify .breadcrumb {
color: rgba(250,248,245,0.72) !important;
}
body.wb-unify .bradcrumbs a,
body.wb-unify .breadcrumbs a,
body.wb-unify .breadcrumb a {
color: #C9A96E !important;
}
/* 8) èáèæàü/ÃÂ¥ÃÂÃÂéÃÂÃÂçúÿ */
body.wb-unify .entry-content table,
body.wb-unify .entry-content hr,
body.wb-unify .bh-article table,
body.wb-unify .bh-article hr {
border-color: rgba(10,22,40,0.12) !important;
}
/* 9) ÃÂ¥ÃÂ
ÃÂäÿáæÃÂïÃ¥ðÃÂÃÂ¥ÃÂà*/
body.wb-unify .entry-content .meta,
body.wb-unify .entry-content small,
body.wb-unify .bh-article .meta,
body.wb-unify .bh-article small {
color: rgba(45,52,54,0.7) !important;
}
</style>
<script id="wb-final-ui-cleanup-js">
(function(){
function clean(){
// ççûéÃÂäÃÂ¥ÃÂÃÂ
Ã¥îùÃÂ¥ÃÂúÃÂ¥ÃÂ
ÃÂçôàèâëéÃÂÃÂèïïèîþçýîçÃÂÃÂçÃÂýèÃÂòÃÂ¥ÃÂÃÂ
èÃÂÃÂæà÷Ã¥üÃÂ
document.querySelectorAll('.entry-content, .bh-article, .wb-services-intro, .wb-page-intro, .wb-services-list').forEach(function(container){
container.querySelectorAll('h1,h2,h3,h4,h5,h6,p,li,span,a,dd,dt,blockquote').forEach(function(el){
var s=el.style;
if(s.color==='rgb(250, 248, 245)' || s.color==='#FAF8F5' || s.color==='#faf8f5' || s.color==='rgb(245, 239, 228)' || s.color==='#F5EFE4'){
s.removeProperty('color');
s.removeProperty('-webkit-text-fill-color');
}
});
});
}
if(document.readyState==='loading'){ document.addEventListener('DOMContentLoaded', clean); }
else { clean(); }
window.addEventListener('load', clean);
setTimeout(clean, 100);
})();
</script>
<?php
}
add_action( 'wp_head', 'wb_final_ui_consistency_fix', 100 );
}
/* ============================================================
* WB-Final-UI-Consistency Fix v4.3 (2026-08-01)
* äýÃÂçÃÂèïüÃÂäûÃ¥éæÃÂéáõäøúÃÂ¥ÃÂúÃÂ¥ÃÂÃÂïüÃÂæÃÂöæÃÂÃÂÃÂ¥ÃÂÃÂ
éáõÃÂ¥ÃÂè Hero/H1ãÃÂÃÂäþçæàÃÂãÃÂÃÂæÃÂÃÂçôâéáõãÃÂÃÂæÃÂÃÂéÃÂîãÃÂÃÂÃÂ¥ÃÂáçÃÂÃÂ
* çÃÂÃÂçûôÃ¥úæçÃÂÃÂèçÃÂèçÃÂäøÃÂèÃÂôæÃÂçïüÃÂäøÃÂæÃÂùÃÂ¥ÃÂèäûûäýÃÂéáõéÃÂâÃÂ¥ÃÂÃÂ
Ã¥îùäøÃÂÃÂ¥ÃÂÃÂèÃÂýæÃÂÃÂÃÂ¥ÃÂÃÂãÃÂÃÂ
* ============================================================ */
if ( ! function_exists( 'wb_final_ui_consistency_fix_v4' ) ) {
function wb_final_ui_consistency_fix_v4() {
if ( is_front_page() ) { return; }
?>
<style id="wb-final-ui-fix-v4">
/* ============================================================
* WB-Final-UI-Consistency Fix v4.3 (2026-08-01)
* ============================================================ */
/* 0) çûÃÂäøÃÂèîþèîáäûäçÃÂà*/
body.wb-unify:not(.home):not(.home-page) {
--navy: #0A1628;
--navy-900: #0A1628;
--navy-2: #12233D;
--gold: #C9A96E;
--gold-500: #C9A96E;
--gold-2: #B8935A;
--ivory: #FAF8F5;
--ink: #2D3436;
--red: #8B1A1A;
}
/* 1) Hero ÃÂ¥ÃÂÃÂ
æàÃÂéâÃÂïüÃÂÃ¥üúÃÂ¥ÃÂöäøÃÂéæÃÂéáõ H1 äøÃÂèÃÂôïüÃÂçÃÂýãÃÂÃÂ44pxãÃÂÃÂ800ïüà*/
body.wb-unify:not(.home):not(.home-page) .wb-hero h1,
body.wb-unify:not(.home):not(.home-page) .wb-hero .wb-hero__title,
body.wb-unify:not(.home):not(.home-page) .wb-hero__in > h1,
body.wb-unify:not(.home):not(.home-page) .wb-hero__in > h2 {
color: #FAF8F5 !important;
-webkit-text-fill-color: #FAF8F5 !important;
font-size: 44px !important;
font-weight: 800 !important;
line-height: 1.2 !important;
letter-spacing: 0 !important;
margin: 0 0 16px !important;
}
body.wb-unify:not(.home):not(.home-page) .wb-hero__in > h2 {
display: block !important;
}
/* 2) æÃÂÃÂçôâéáõ / 404 éáõæàÃÂéâÃÂÃ¥øæïüÃÂæ÷ñèÃÂÃÂèÃÂÃÂæÃÂï + çÃÂýÃÂ¥ÃÂÃÂïüÃÂÃ¥ïùéýÃÂéæÃÂéáõ Hero */
body.search.wb-unify:not(.home),
body.error404.wb-unify:not(.home) {
background-color: #0A1628 !important;
}
body.search.wb-unify:not(.home) main,
body.error404.wb-unify:not(.home) main {
background-color: #FAF8F5 !important;
padding-top: 0 !important;
}
body.search.wb-unify:not(.home) .wb-search-title,
body.error404.wb-unify:not(.home) .wb-404-title,
body.search.wb-unify:not(.home) main > h1,
body.error404.wb-unify:not(.home) main > h1 {
display: block !important;
visibility: visible !important;
opacity: 1 !important;
color: #FAF8F5 !important;
-webkit-text-fill-color: #FAF8F5 !important;
font-size: 44px !important;
font-weight: 800 !important;
line-height: 1.2 !important;
background: linear-gradient(135deg, #0A1628 0%, #12233D 100%) !important;
margin: 0 -24px 24px !important;
padding: 72px 24px 56px !important;
width: calc(100% + 48px) !important;
box-sizing: border-box !important;
border-bottom: 1px solid rgba(201,169,110,0.22) !important;
}
/* 3) äþçæàÃÂÃ¥ðÃÂéÃÂèäûöæàÃÂéâÃÂÃÂ¥ÃÂèæõÃÂ
èÃÂòèÃÂÃÂæÃÂïäøÃÂæ÷ñèÃÂòÃÂ¥ÃÂïèïû */
body.wb-unify:not(.home):not(.home-page) .widget-title,
body.wb-unify:not(.home):not(.home-page) .wp-block-heading {
color: #0A1628 !important;
-webkit-text-fill-color: #0A1628 !important;
}
/* 4) æÃÂÃÂçôâéáõÃÂ¥ÃÂÃÂ
Ã¥îùÃÂ¥ÃÂúçûÃÂäøÃÂäøúæõÃÂ
èÃÂòæáÃÂæÃÂö */
body.search.wb-unify:not(.home) .content-vw,
body.search.wb-unify:not(.home) .entry-content,
body.search.wb-unify:not(.home) .site-main,
body.search.wb-unify:not(.home) #primary,
body.search.wb-unify:not(.home) .content-area,
body.search.wb-unify:not(.home) .middle-align {
background-color: #FAF8F5 !important;
color: #2D3436 !important;
}
body.search.wb-unify:not(.home) article,
body.search.wb-unify:not(.home) .post,
body.search.wb-unify:not(.home) .search-result {
background-color: #fff !important;
border: 1px solid rgba(10,22,40,0.08) !important;
border-radius: 12px !important;
box-shadow: 0 2px 12px rgba(10,22,40,0.06) !important;
color: #2D3436 !important;
}
body.search.wb-unify:not(.home) article h2,
body.search.wb-unify:not(.home) article .entry-title,
body.search.wb-unify:not(.home) .post h2,
body.search.wb-unify:not(.home) .search-result h2 {
color: #0A1628 !important;
}
body.search.wb-unify:not(.home) article p,
body.search.wb-unify:not(.home) article .entry-summary,
body.search.wb-unify:not(.home) .search-result p {
color: #2D3436 !important;
}
body.search.wb-unify:not(.home) a.read-more,
body.search.wb-unify:not(.home) .entry-content a {
color: #1a5490 !important;
}
body.search.wb-unify:not(.home) a.read-more:hover,
body.search.wb-unify:not(.home) .entry-content a:hover {
color: #C9A96E !important;
}
/* 5) æÃÂÃÂéÃÂîèçÃÂèçÃÂçûÃÂäøà*/
body.wb-unify:not(.home):not(.home-page) .wb-btn,
body.wb-unify:not(.home):not(.home-page) .bh-btn,
body.wb-unify:not(.home):not(.home-page) .wb-hero__cta a,
body.wb-unify:not(.home):not(.home-page) .btn {
border-radius: 8px !important;
padding: 12px 22px !important;
font-weight: 600 !important;
font-size: 16px !important;
}
/* 6) èáèÃÂ¥ÃÂÃÂæÃÂçäûöçûÃÂäøà*/
body.wb-unify:not(.home):not(.home-page) input[type="text"],
body.wb-unify:not(.home):not(.home-page) input[type="email"],
body.wb-unify:not(.home):not(.home-page) input[type="search"],
body.wb-unify:not(.home):not(.home-page) input[type="tel"],
body.wb-unify:not(.home):not(.home-page) textarea,
body.wb-unify:not(.home):not(.home-page) select {
background-color: #fff !important;
border: 1px solid rgba(10,22,40,0.22) !important;
color: #2D3436 !important;
border-radius: 8px !important;
}
/* 7) ÃÂ¥ÃÂáçÃÂÃÂçûÃÂäøà*/
body.wb-unify:not(.home):not(.home-page) .card,
body.wb-unify:not(.home):not(.home-page) .bh-card,
body.wb-unify:not(.home):not(.home-page) .wb-card {
background-color: #fff !important;
border: 1px solid rgba(10,22,40,0.08) !important;
border-radius: 12px !important;
box-shadow: 0 2px 12px rgba(10,22,40,0.05) !important;
color: #2D3436 !important;
}
/* 8) éÃÂÃÂèÃÂÃÂæÃÂçéáõçÃÂÃÂ/éáõèÃÂà*/
body.wb-unify:not(.home):not(.home-page) header[role="banner"]:not(.wb-top),
body.wb-unify:not(.home):not(.home-page) footer[role="contentinfo"]:not(.wb-foot) {
display: none !important;
}
</style>
<script id="wb-final-ui-js-v4">
/* WB-Final-UI-Consistency JS v4.3 */
(function(){
function fixHeroTitle(){
if (document.body.classList.contains('home') || document.body.classList.contains('home-page')) return;
var hero = document.querySelector('.wb-hero, .hero');
if (!hero) return;
var heroIn = hero.querySelector('.wb-hero__in') || hero;
if (heroIn.querySelector('h1')) return;
var heroH2 = heroIn.querySelector('h2');
if (heroH2) {
heroH2.classList.add('wb-hero__title');
return;
}
var contentH1 = document.querySelector('.entry-content h1, .bh-article h1, .wb-page-intro h1, main h1');
if (!contentH1) return;
var txt = (contentH1.textContent || '').trim();
if (!txt) return;
var h1 = document.createElement('h1');
h1.className = 'wb-hero__title';
h1.textContent = txt;
heroIn.insertBefore(h1, heroIn.firstChild);
}
function fixSearchTitle(){
var isSearch = document.body.classList.contains('search');
var is404 = document.body.classList.contains('error404');
if (!isSearch && !is404) return;
var h1 = document.querySelector('header h1, .page-header h1');
if (!h1) return;
if (h1.offsetParent !== null && h1.getBoundingClientRect().height > 0) return;
var wrap = document.querySelector('main .content-vw, main .middle-align, main, .site-main');
if (!wrap) return;
var hasDirectH1 = Array.prototype.some.call(wrap.children, function(c){ return c.tagName === 'H1'; });
if (hasDirectH1) return;
wrap.insertBefore(h1, wrap.firstChild);
var cls = isSearch ? 'wb-search-title' : 'wb-404-title';
h1.className = (h1.className ? h1.className + ' ' : '') + cls;
h1.style.cssText = 'display:block!important;visibility:visible!important;opacity:1!important;';
}
function run(){
fixHeroTitle();
fixSearchTitle();
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', run);
} else {
run();
}
window.addEventListener('load', run);
setTimeout(run, 120);
})();
</script>
<?php
}
add_action( 'wp_head', 'wb_final_ui_consistency_fix_v4', 999 );
}
// =============================================
// WB UI Consistency Fix v5 âÃÂà2026-08-01 21:00
// =============================================
if (!function_exists('wb_ui_fix_v5')){
function wb_ui_fix_v5(){
if (is_front_page()) return;
echo '<style id="wb-ui-fix-v5">\nFix v5 âÃÂàäûÃ¥éæÃÂéáõäøúÃÂ¥ÃÂúÃÂ¥ÃÂÃÂÃ¥ïùéýÃÂÃÂ¥ÃÂ
èçëà*/\n/* 1. æÃÂâÃ¥äÃÂÃÂ¥ÃÂÃÂ
éáõçûÃÂäøÃÂéáõèÃÂà*/\nbody.wb-unify footer.wb-footer{display:block!important}\nbody.wb-unify:not(.home):not(.home-page) footer.foot,\nbody.wb-unify:not(.home):not(.home-page) footer[role="contentinfo"]:not(.wb-footer){display:none!important}\n/* 2. ÃÂ¥ÃÂáçÃÂÃÂÃ¥îùÃÂ¥ÃÂèèÿÃÂÃÂ¥ÃÂà*/\nbody.wb-unify a.bh-card:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8),\nbody.wb-unify div.bh-card:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8){\n display:flex!important;flex-direction:column!important;gap:8px!important;\n background-color:#FFFFFF!important;border-radius:12px!important;\n border:1px solid rgba(234,228,216,0.7)!important;padding:24px!important;\n box-shadow:0 1px 3px rgba(10,22,40,.06),0 4px 12px rgba(10,22,40,.08)!important;\n color:#2D3436!important;text-decoration:none!important}\n/* 3. CTA æÃÂÃÂéÃÂîçûÃÂäøà*/\nbody.wb-unify a.wb-btn:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8),\nbody.wb-unify a.bh-btn:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8){padding:14px 30px!important}\n/* 4. äÿÃÂæÃÂäæõîÃÂ¥ÃÂèæÃÂÃÂéÃÂî */\nbody.wb-unify .float button,body.wb-unify .float__tel,body.wb-unify .float__wx{\n border-radius:50%!important;width:52px!important;height:52px!important;\n min-width:52px!important;max-width:52px!important;padding:12px!important;\n display:inline-flex!important;align-items:center!important;justify-content:center!important;\n box-shadow:0 2px 10px rgba(0,0,0,.25)!important}\n</style>';
}
add_action('wp_head','wb_ui_fix_v5',999);
}
if (!function_exists('wb_ui_fix_v5_js')){
function wb_ui_fix_v5_js(){
if (is_front_page()) return;
echo '<script id="wb-ui-fix-v5-js">document.addEventListener("DOMContentLoaded",function(){(function(){
(function(){
if(document.body.classList.contains(\'home\')||document.body.classList.contains(\'home-page\'))return;
document.querySelectorAll(\'footer.wb-footer\').forEach(function(f){
f.style.setProperty(\'display\',\'block\',\'important\');
f.style.setProperty(\'visibility\',\'visible\',\'important\');
});
document.querySelectorAll(\'footer.foot\').forEach(function(f){
if(!f.classList.contains(\'wb-footer\'))f.style.setProperty(\'display\',\'none\',\'important\');
});
document.querySelectorAll(\'.bh-card\').forEach(function(c){
var s=getComputedStyle(c);
if(s.backgroundColor===\'rgba(0, 0, 0, 0)\'||s.backgroundColor===\'transparent\'||s.borderRadius===\'0px\'){
c.style.setProperty(\'background-color\',\'#FFFFFF\',\'important\');
c.style.setProperty(\'border-radius\',\'12px\',\'important\');
c.style.setProperty(\'border\',\'1px solid rgba(234,228,216,0.7)\',\'important\');
c.style.setProperty(\'padding\',\'24px\',\'important\');
c.style.setProperty(\'box-shadow\',\'0 1px 3px rgba(10,22,40,.06),0 4px 12px rgba(10,22,40,.08)\',\'important\');
c.style.setProperty(\'color\',\'#2D3436\',\'important\');
c.style.setProperty(\'text-decoration\',\'none\',\'important\');
}
});
document.querySelectorAll(\'.wb-btn,.bh-btn\').forEach(function(b){
var s=getComputedStyle(b);
if(!s.padding.includes(\'30px\'))b.style.setProperty(\'padding\',\'14px 30px\',\'important\');
});
document.querySelectorAll(\'.float__wx,.float__tel,.float button\').forEach(function(fb){
fb.style.setProperty(\'border-radius\',\'50%\',\'important\');
fb.style.setProperty(\'width\',\'52px\',\'important\');
fb.style.setProperty(\'height\',\'52px\',\'important\');
fb.style.setProperty(\'min-width\',\'52px\',\'important\');
fb.style.setProperty(\'max-width\',\'52px\',\'important\');
fb.style.setProperty(\'padding\',\'12px\',\'important\');
});
})();
var b=document.body;if((b.classList.contains(\'search\')||b.classList.contains(\'error404\'))&&!document.querySelector(\'.wb-hero\')){
var m=document.querySelector(\'main,#main,.site-main\'),h1=document.querySelector(\'h1\');
if(m&&h1){var d=document.createElement(\'div\');d.className=\'wb-hero\';d.innerHTML=\'<div class=wb-hero__in><div class=wb-hero__title>\'+h1.innerHTML+\'</div></div>\';m.insertBefore(d,m.firstChild)}
}})();});</script>';
}
add_action('wp_footer','wb_ui_fix_v5_js',999);
}
// End v5
// WB UI Fix v5.1 â 2026-08-01 21:00 hotfix
if (!function_exists('wb_ui_fix_v51')){
function wb_ui_fix_v51(){
if (is_front_page()) return;
echo '<style id="wb-ui-fix-v51">\n/* WB UI Fix v5.1 â é«Âç¹å¼ÂæÂ§è¦Âç */\n/* 1. 页èÂÂæÂ¢å¤Âï¼Âç¹å¼ÂæÂ§ (0,4,1) > v4çÂÂ(0,3,1) */\nbody.wb-unify:not(.home):not(.home-page) footer.wb-footer,\nbody.wb-unify:not(.home):not(.home-page) footer.wb-footer[role="contentinfo"]{display:block!important;visibility:visible!important}\n/* 2. å¡çÂÂæÂ¢å¤Âï¼Â(0,10,2) >> FIX-02 (0,7,1) */\nbody.wb-unify:not(.home):not(.home-page) a.bh-card:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8),\nbody.wb-unify:not(.home):not(.home-page) div.bh-card:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8){\ndisplay:flex!important;flex-direction:column!important;gap:8px!important;\nbackground-color:#FFFFFF!important;border-radius:12px!important;\nborder:1px solid rgba(234,228,216,0.7)!important;padding:24px!important;\nbox-shadow:0 1px 3px rgba(10,22,40,.06),0 4px 12px rgba(10,22,40,.08)!important;\ncolor:#2D3436!important;text-decoration:none!important}\n/* 3. CTAæÂÂé®paddingç»Âä¸Â为é¦Â页æ ÂÃ¥ÂÂ14px30pxï¼Â(0,10,2) > v4(0,9,2) */\nbody.wb-unify:not(.home):not(.home-page) a.wb-btn:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8),\nbody.wb-unify:not(.home):not(.home-page) a.bh-btn:not(.wbz1):not(.wbz2):not(.wbz3):not(.wbz4):not(.wbz5):not(.wbz6):not(.wbz7):not(.wbz8){\npadding:14px 30px!important}\n/* 4. æµ®å¨æÂÂé®ä¿ÂæÂ¤ */\nbody.wb-unify .float button,body.wb-unify .float__tel,body.wb-unify .float__wx{\nborder-radius:50%!important;width:52px!important;height:52px!important;\nmin-width:52px!important;max-width:52px!important;padding:12px!important;\ndisplay:inline-flex!important;align-items:center!important;justify-content:center!important}\n</style>';
}
add_action('wp_head','wb_ui_fix_v51',9999);
}
// End v5.1
/* ============================================================
* WB-UI-Consistency Patch v28 (2026-08-02)
* Round-2 audit fixes. All text uses \u escapes / HTML entities
* to stay ASCII-safe (prevents mojibake on editor round-trip).
*
* E1: category/archive pages missing unified hero frame
* E2: some single posts render body H1 at 40px (baseline 44px)
* E3: archive main container not aligned to 1200px grid
* E4: floating action buttons have mojibake aria-labels
* ============================================================ */
if ( ! function_exists( 'wb_v28_consistency_css' ) ) {
function wb_v28_consistency_css() {
echo '<style id="wb-consistency-v28">';
/* E2: unify body H1 to homepage baseline 44px/800 */
echo 'body.wb-unify .entry-content > h1,';
echo 'body.wb-unify article > h1,';
echo 'body.wb-unify .bh-article > h1,';
echo 'body.wb-unify .wb-hero h1,';
echo 'body.wb-unify h2.wb-hero__title{';
echo 'font-size:44px!important;font-weight:800!important;line-height:1.25!important;}';
echo '@media(max-width:1200px){';
echo 'body.wb-unify .entry-content > h1,body.wb-unify article > h1,';
echo 'body.wb-unify .bh-article > h1,body.wb-unify .wb-hero h1,';
echo 'body.wb-unify h2.wb-hero__title{font-size:32px!important;}}';
/* E1: hero frame injected on archives - visual spec identical to homepage */
echo 'body.wb-unify .wb-hero--v28{';
echo 'width:100vw!important;max-width:none!important;';
echo 'margin-left:calc((100vw - 100%)/-2)!important;';
echo 'background:linear-gradient(135deg,#0A1628 0%,#12243F 100%)!important;';
echo 'padding:72px 120px 56px!important;box-sizing:border-box!important;}';
echo 'body.wb-unify .wb-hero--v28 .wb-hero__in{';
echo 'max-width:1200px!important;margin:0 auto!important;padding:0!important;}';
echo 'body.wb-unify .wb-hero--v28 .wb-hero__tag{';
echo 'font-size:14px!important;color:#C9A96E!important;margin-bottom:14px!important;}';
echo 'body.wb-unify .wb-hero--v28 h1,';
echo 'body.wb-unify .wb-hero--v28 .page-title{';
echo 'font-size:44px!important;font-weight:800!important;line-height:1.25!important;';
echo 'color:#FAF8F5!important;-webkit-text-fill-color:#FAF8F5!important;';
echo 'margin:0 0 16px!important;}';
echo 'body.wb-unify .wb-hero--v28 .page-title span{color:#FAF8F5!important;}';
echo 'body.wb-unify .wb-hero--v28 .wb-hero__cta{';
echo 'display:flex!important;gap:14px!important;flex-wrap:wrap!important;margin-top:8px!important;}';
echo '@media(max-width:1200px){body.wb-unify .wb-hero--v28{padding:48px 24px 36px!important;}';
echo 'body.wb-unify .wb-hero--v28 h1,body.wb-unify .wb-hero--v28 .page-title{font-size:32px!important;}}';
/* E3: archive content container aligned to homepage 1200px grid */
echo 'body.wb-unify.archive main > .container,';
echo 'body.wb-unify.category main > .container,';
echo 'body.wb-unify.search main > .container{';
echo 'max-width:1200px!important;margin-left:auto!important;margin-right:auto!important;}';
echo '</style>';
}
add_action( 'wp_head', 'wb_v28_consistency_css', 120 );
}
/*
* E1 + E4 runtime fixes.
* Strict rule: never delete or rewrite existing text nodes.
* The archive title node is MOVED (appendChild) so its text is preserved byte-for-byte.
*/
if ( ! function_exists( 'wb_v28_runtime_fix' ) ) {
function wb_v28_runtime_fix() {
if ( is_front_page() ) { return; }
?>
<script id="wb-v28-runtime">
(function(){
function ready(fn){
if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',fn);}else{fn();}
}
ready(function(){
var body=document.body;
if(!body||!body.classList.contains('wb-unify')) return;
/* ---- E4: restore mojibake aria-labels on floating buttons ---- */
var LBL={tel:'\u7535\u8bdd\u54a8\u8be2', wx:'\u5fae\u4fe1\u54a8\u8be2'};
function badLabel(v){ return !v || /\u00c3|\u00c2/.test(v); }
var tel=document.querySelector('.float .float__tel, .float a[href^="tel:"]');
if(tel && badLabel(tel.getAttribute('aria-label'))) tel.setAttribute('aria-label',LBL.tel);
var wx=document.querySelector('.float .float__wx, .float button');
if(wx && badLabel(wx.getAttribute('aria-label'))) wx.setAttribute('aria-label',LBL.wx);
/* ---- E1: build unified hero on archive / category / search ---- */
var isArchive = body.classList.contains('archive') ||
body.classList.contains('category') ||
body.classList.contains('search');
if(!isArchive) return;
if(document.querySelector('.wb-hero, .wb-hero--v28')) return;
/* locate the native archive header that holds the page title */
var titleEl = document.querySelector('main .page-title, main header h1, .page-title');
if(!titleEl) return;
var nativeHeader = titleEl.closest('header');
var anchor = nativeHeader || titleEl;
if(!anchor.parentNode) return;
/* breadcrumb text: reuse the title's own text, never invent content */
var titleText=(titleEl.textContent||'').replace(/\s+/g,' ').trim();
var hero=document.createElement('section');
hero.className='wb-hero wb-hero--v28';
hero.id='wbHero';
var inner=document.createElement('div');
inner.className='wb-hero__in';
var tag=document.createElement('div');
tag.className='wb-hero__tag';
var homeLink=document.createElement('a');
homeLink.href='/';
homeLink.textContent='\u9996\u9875'; /* Home */
homeLink.style.color='inherit';
homeLink.style.textDecoration='none';
tag.appendChild(homeLink);
tag.appendChild(document.createTextNode(' \u00bb '+titleText));
inner.appendChild(tag);
/* MOVE the original title node - text preserved exactly */
inner.appendChild(titleEl);
/* CTA buttons identical to homepage/inner pages */
var cta=document.createElement('div');
cta.className='wb-hero__cta';
var a1=document.createElement('a');
a1.className='wb-btn wb-btn--gold';
a1.href='tel:18511835733';
a1.style.padding='14px 30px';
a1.textContent='\u260e \u7535\u8bdd\u54a8\u8be2 18511835733'; /* phone consult */
var a2=document.createElement('a');
a2.className='wb-btn wb-btn--ghost';
a2.href='/contact/contact-appoint/';
a2.style.padding='14px 30px';
a2.textContent='\u5728\u7ebf\u9884\u7ea6\u54a8\u8be2 \u2192'; /* online booking */
cta.appendChild(a1); cta.appendChild(a2);
inner.appendChild(cta);
hero.appendChild(inner);
anchor.parentNode.insertBefore(hero,anchor);
/* hide the now-empty native header shell (no text left inside) */
if(nativeHeader && !(nativeHeader.textContent||'').trim()){
nativeHeader.style.display='none';
}
});
})();
</script>
<?php
}
add_action( 'wp_footer', 'wb_v28_runtime_fix', 30 );
}
/* End WB-UI-Consistency Patch v28 */
/* ============================================================
* WB-UI-Consistency Patch v29 (2026-08-02)
* Align the homepage font-family declaration with inner pages.
* Primary fonts are already identical (PingFang SC / Microsoft
* YaHei / Noto Sans SC), so rendering does not change; this only
* makes the declared fallback stack uniform site-wide.
* ============================================================ */
if ( ! function_exists( 'wb_v29_font_stack_unify' ) ) {
function wb_v29_font_stack_unify() {
echo '<style id="wb-font-stack-v29">';
echo 'body,body.wb-unify,body.home{';
echo 'font-family:"PingFang SC","Microsoft YaHei","Noto Sans SC",';
echo '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,';
echo '"Helvetica Neue",Arial,sans-serif!important;}';
echo '</style>';
}
add_action( 'wp_head', 'wb_v29_font_stack_unify', 130 );
}
/* End WB-UI-Consistency Patch v29 */
2026年7月19日2026年7月19日|
zaishangyanfazaishangyanfa|
|
14:41
Fatal error: Uncaught Error: Call to undefined function law_firm_lite_edit_link() in /www/wwwroot/zaishangyanfa.com/wp-content/themes/law-firm-lite/template-parts/content.php:44
Stack trace:
#0 /www/wwwroot/zaishangyanfa.com/wp-includes/template.php(816): require()
#1 /www/wwwroot/zaishangyanfa.com/wp-includes/template.php(749): load_template()
#2 /www/wwwroot/zaishangyanfa.com/wp-includes/general-template.php(206): locate_template()
#3 /www/wwwroot/zaishangyanfa.com/wp-content/themes/law-firm-lite/archive.php(69): get_template_part()
#4 /www/wwwroot/zaishangyanfa.com/wp-includes/template-loader.php(132): include('...')
#5 /www/wwwroot/zaishangyanfa.com/wp-blog-header.php(19): require_once('...')
#6 /www/wwwroot/zaishangyanfa.com/index.php(17): require('...')
#7 {main}
thrown in
/www/wwwroot/zaishangyanfa.com/wp-content/themes/law-firm-lite/template-parts/content.php on line
44