<?php /** * PowerX Theme Functions v8 - Complete UI & Content Fixes * - Single Unified Top Utility Bar + White Main Header (No 2 headers issue). * - Mobile Menu Drawer matching 1:1 reference mockup (white panel, active gold pill, icons, no bullets, social icons). * - Global Colors & Fonts Customizer System in WP Admin (Header & Colors ⚙️). * - Universal Hero Slider + Quote Form at Top & FAQ Accordion at Bottom of every page. * - Cache flushing on save. */ // 1. Dynamic Colors & Fonts CSS add_action('wp_head', function() { $primary = get_option('powerx_primary_color', '#D97706'); $secondary = get_option('powerx_secondary_color', '#2563EB'); $header_bg = get_option('powerx_header_bg', '#FFFFFF'); $header_txt = get_option('powerx_header_text', '#0F172A'); $header_hvr = get_option('powerx_header_hover', '#D97706'); $topbar_bg = get_option('powerx_topbar_bg', '#0F172A'); $topbar_txt = get_option('powerx_topbar_text', '#CBD5E1'); $cta_bg = get_option('powerx_cta_bg', '#D97706'); $cta_txt = get_option('powerx_cta_text', '#FFFFFF'); $font_fam = get_option('powerx_font_family', 'system-ui, -apple-system, sans-serif'); ?> <style id="powerx-dynamic-theme-styles"> :root { --px-primary: <?php echo esc_attr($primary); ?>; --px-secondary: <?php echo esc_attr($secondary); ?>; --px-header-bg: <?php echo esc_attr($header_bg); ?>; --px-header-text: <?php echo esc_attr($header_txt); ?>; --px-header-hover: <?php echo esc_attr($header_hvr); ?>; --px-topbar-bg: <?php echo esc_attr($topbar_bg); ?>; --px-topbar-text: <?php echo esc_attr($topbar_txt); ?>; --px-cta-bg: <?php echo esc_attr($cta_bg); ?>; --px-cta-text: <?php echo esc_attr($cta_txt); ?>; --px-font-family: <?php echo esc_attr($font_fam); ?>; } body { font-family: var(--px-font-family) !important; background-color: #0B132B !important; color: #F1F5F9 !important; margin: 0; padding: 0; } /* HIDE ANY BLOCK THEME OR SECONDARY HEADERS */ header:not(#px-main-white-header), .wp-block-template-part-header, .site-header:not(#px-main-white-header), #masthead:not(#px-main-white-header) { display: none !important; height: 0 !important; overflow: hidden !important; visibility: hidden !important; } /* Desktop Navigation Styling */ .px-header-dynamic-menu-list { list-style: none !important; margin: 0 !important; padding: 0 !important; display: flex !important; align-items: center !important; gap: 26px !important; } .px-header-dynamic-menu-list li { list-style: none !important; margin: 0 !important; padding: 0 !important; } .px-header-dynamic-menu-list a { color: var(--px-header-text) !important; font-weight: 700 !important; font-size: 15px !important; text-decoration: none !important; transition: color 0.2s ease !important; } .px-header-dynamic-menu-list a:hover { color: var(--px-header-hover) !important; } /* Mobile Drawer Menu Reset & Styling (White Panel 1:1 Matching Mockup) */ .px-mobile-drawer-menu-list { list-style: none !important; margin: 0 !important; padding: 0 !important; display: flex !important; flex-direction: column !important; gap: 8px !important; } .px-mobile-drawer-menu-list li { list-style: none !important; margin: 0 !important; padding: 0 !important; } .px-mobile-drawer-menu-list a { display: flex !important; align-items: center !important; justify-content: space-between !important; padding: 12px 16px !important; border-radius: 10px !important; color: #0F172A !important; font-weight: 700 !important; font-size: 15px !important; text-decoration: none !important; transition: background 0.2s ease, color 0.2s ease !important; } .px-mobile-drawer-menu-list a.active, .px-mobile-drawer-menu-list li.current-menu-item > a { background: #FEF3C7 !important; color: #D97706 !important; font-weight: 800 !important; } .px-mobile-drawer-menu-list a:hover { background: #F1F5F9 !important; } .px-gold-cta-btn { background: var(--px-cta-bg) !important; color: var(--px-cta-text) !important; } @media (max-width: 991px) { .px-desktop-menu { display: none !important; } .px-mobile-toggle { display: inline-flex !important; } } @media (min-width: 992px) { .px-mobile-toggle { display: none !important; } } </style> <?php }, 1); add_action('wp_enqueue_scripts', function() { wp_enqueue_style('powerx-style', get_stylesheet_uri(), array(), time()); wp_dequeue_style('spectra-gs-utility-classes'); wp_deregister_style('spectra-gs-utility-classes'); }, 9999); add_action('admin_menu', function() { add_theme_page(__('Menus'), __('Menus 📋'), 'edit_theme_options', 'nav-menus.php'); }, 999); add_action('after_setup_theme', function() { register_nav_menus(array( 'primary' => __('Primary Header Menu', 'powerx'), 'mobile' => __('Mobile Header Menu', 'powerx'), )); add_theme_support('menus'); add_theme_support('title-tag'); add_theme_support('post-thumbnails'); add_theme_support('custom-logo'); }); add_action('wp_update_nav_menu', 'powerx_clear_all_caches'); add_action('save_post', 'powerx_clear_all_caches'); add_action('after_switch_theme', 'powerx_clear_all_caches'); function powerx_clear_all_caches() { if (function_exists('wp_cache_flush')) { @wp_cache_flush(); } if (function_exists('opcache_reset')) { @opcache_reset(); } } add_action('admin_init', function() { $engines_page = get_page_by_path('engines'); if (!$engines_page) { wp_insert_post(array( 'post_title' => 'Used Engines for Sale', 'post_name' => 'engines', 'post_status' => 'publish', 'post_type' => 'page', 'post_content' => '<p>Quality used OEM automotive engines matched to your VIN. Compression tested & nationwide shipping.</p>' )); } $trans_page = get_page_by_path('transmissions'); if (!$trans_page) { wp_insert_post(array( 'post_title' => 'Used Transmissions for Sale', 'post_name' => 'transmissions', 'post_status' => 'publish', 'post_type' => 'page', 'post_content' => '<p>Quality used OEM transmissions matched to your VIN. Automatic, manual, and CVT units available.</p>' )); } }); // CSV Export add_action('admin_init', function() { if (isset($_GET['page']) && $_GET['page'] === 'powerx-leads' && isset($_GET['export_csv']) && $_GET['export_csv'] == '1') { if (!current_user_can('manage_options')) return; global $wpdb; $table_name = $wpdb->prefix . 'powerx_leads'; $leads = $wpdb->get_results("SELECT * FROM $table_name ORDER BY id DESC", ARRAY_A); if (ob_get_level()) ob_end_clean(); header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename=powerx_leads_' . date('Y-m-d') . '.csv'); header('Pragma: no-cache'); header('Expires: 0'); $output = fopen('php://output', 'w'); fputcsv($output, array('ID', 'Date', 'Part Type', 'Make', 'Model', 'Year', 'Variant', 'Full Name', 'Email', 'Phone', 'VIN')); if (!empty($leads)) { foreach ($leads as $row) { fputcsv($output, array( $row['id'], $row['created_at'], $row['part_type'], $row['make'], $row['model'], $row['year'], $row['variant'], $row['full_name'], $row['email'], $row['phone'], $row['vin'] )); } } fclose($output); exit; } }); // Admin Menu Settings add_action('admin_menu', function() { add_menu_page( 'Header, Slider & Theme Settings', 'Header & Colors ⚙️', 'manage_options', 'powerx-header-slider', 'powerx_render_header_slider_admin_page', 'dashicons-admin-appearance', 25 ); }); function powerx_render_header_slider_admin_page() { if (!current_user_can('manage_options')) return; if (isset($_POST['powerx_save_all']) && check_admin_referer('powerx_settings_action', 'powerx_settings_nonce')) { update_option('powerx_primary_color', sanitize_hex_color($_POST['powerx_primary_color'])); update_option('powerx_header_bg', sanitize_hex_color($_POST['powerx_header_bg'])); update_option('powerx_header_text', sanitize_hex_color($_POST['powerx_header_text'])); update_option('powerx_header_hover', sanitize_hex_color($_POST['powerx_header_hover'])); update_option('powerx_topbar_bg', sanitize_hex_color($_POST['powerx_topbar_bg'])); update_option('powerx_topbar_text', sanitize_hex_color($_POST['powerx_topbar_text'])); update_option('powerx_cta_bg', sanitize_hex_color($_POST['powerx_cta_bg'])); update_option('powerx_cta_text', sanitize_hex_color($_POST['powerx_cta_text'])); update_option('powerx_font_family', sanitize_text_field($_POST['powerx_font_family'])); $slides = array( 1 => array( 'bg' => sanitize_text_field($_POST['slide1_bg']), 'pill' => sanitize_text_field($_POST['slide1_pill']), 'h1' => sanitize_text_field($_POST['slide1_h1']), 'desc' => sanitize_textarea_field($_POST['slide1_desc']), ), 2 => array( 'bg' => sanitize_text_field($_POST['slide2_bg']), 'pill' => sanitize_text_field($_POST['slide2_pill']), 'h1' => sanitize_text_field($_POST['slide2_h1']), 'desc' => sanitize_textarea_field($_POST['slide2_desc']), ), ); update_option('powerx_hero_slides_data', $slides); update_option('powerx_form_parts_list', sanitize_textarea_field($_POST['powerx_form_parts_list'])); update_option('powerx_form_makes_list', sanitize_textarea_field($_POST['powerx_form_makes_list'])); update_option('powerx_form_start_year', intval($_POST['powerx_form_start_year'])); update_option('powerx_form_end_year', intval($_POST['powerx_form_end_year'])); update_option('powerx_enable_autoresponder', isset($_POST['powerx_enable_autoresponder']) ? '1' : '0'); update_option('powerx_admin_email_recipient', sanitize_email($_POST['powerx_admin_email_recipient'])); update_option('powerx_email_subject', sanitize_text_field($_POST['powerx_email_subject'])); update_option('powerx_email_body', sanitize_textarea_field($_POST['powerx_email_body'])); powerx_clear_all_caches(); echo '<div class="updated"><p><strong>All Theme Colors, Fonts, Header & Slider Settings Saved Successfully!</strong></p></div>'; } $primary = get_option('powerx_primary_color', '#D97706'); $header_bg = get_option('powerx_header_bg', '#FFFFFF'); $header_txt = get_option('powerx_header_text', '#0F172A'); $header_hvr = get_option('powerx_header_hover', '#D97706'); $topbar_bg = get_option('powerx_topbar_bg', '#0F172A'); $topbar_txt = get_option('powerx_topbar_text', '#CBD5E1'); $cta_bg = get_option('powerx_cta_bg', '#D97706'); $cta_txt = get_option('powerx_cta_text', '#FFFFFF'); $font_fam = get_option('powerx_font_family', 'system-ui, -apple-system, sans-serif'); $slides = get_option('powerx_hero_slides_data', array()); $slide1_bg = !empty($slides[1]['bg']) ? $slides[1]['bg'] : 'https://images.unsplash.com/photo-1580273916550-e323be2ae537?auto=format&fit=crop&w=1600&q=80'; $slide1_pill = !empty($slides[1]['pill']) ? $slides[1]['pill'] : 'QUALITY USED OEM AUTOMOTIVE COMPONENTS'; $slide1_h1 = !empty($slides[1]['h1']) ? $slides[1]['h1'] : 'Used Engines for Sale | High Performance & Low Mileage'; $slide1_desc = !empty($slides[1]['desc']) ? $slides[1]['desc'] : 'Tested, certified used OEM engines with up to 100-day warranty coverage. Tested compression & nationwide fast delivery.'; $slide2_bg = !empty($slides[2]['bg']) ? $slides[2]['bg'] : 'https://images.unsplash.com/photo-1486006920555-c77dce18193b?auto=format&fit=crop&w=1600&q=80'; $slide2_pill = !empty($slides[2]['pill']) ? $slides[2]['pill'] : 'QUALITY USED OEM AUTOMOTIVE COMPONENTS'; $slide2_h1 = !empty($slides[2]['h1']) ? $slides[2]['h1'] : 'Used Transmissions for Sale | Automatic, Manual & CVT'; $slide2_desc = !empty($slides[2]['desc']) ? $slides[2]['desc'] : 'Quality used OEM transmissions matched to your VIN. Automatic, manual and CVT units with multiple mileage options and warranty coverage.'; $parts_list = get_option('powerx_form_parts_list', "Engine, Transmission, Reman Engine, Used Engine, Used Transmission, Transfer Case"); $makes_list = get_option('powerx_form_makes_list', "Acura, Audi, BMW, Chevrolet, Dodge, Ford, GMC, Honda, Hyundai, Jeep, Nissan, Toyota, RAM, Subaru, Volkswagen, Volvo"); $start_year = get_option('powerx_form_start_year', 1990); $end_year = get_option('powerx_form_end_year', 2026); $enable_auto = get_option('powerx_enable_autoresponder', '1'); $admin_email = get_option('powerx_admin_email_recipient', 'info@powerxautoparts.com'); $email_subj = get_option('powerx_email_subject', 'We Received Your Quote Request - PowerX Auto Parts'); $email_body = get_option('powerx_email_body', "Hello {NAME}, Thank you for requesting a quote for your {YEAR} {MAKE} {MODEL} ({PART})..."); ?> <div class="wrap"> <h1>Global Colors, Fonts & Theme Settings ⚙️</h1> <form method="post" action=""> <?php wp_nonce_field('powerx_settings_action', 'powerx_settings_nonce'); ?> <div style="background:#fff; border:1px solid #ccd0d4; padding:20px; margin-bottom:24px; border-radius:8px; max-width:850px;"> <h2>1. Global Colors & Fonts Customizer System 🎨</h2> <table class="form-table"> <tr><th>Primary Accent Color</th><td><input type="color" name="powerx_primary_color" value="<?php echo esc_attr($primary); ?>"> <code><?php echo esc_html($primary); ?></code></td></tr> <tr><th>Header Bar Background</th><td><input type="color" name="powerx_header_bg" value="<?php echo esc_attr($header_bg); ?>"> <code><?php echo esc_html($header_bg); ?></code></td></tr> <tr><th>Header Text & Links</th><td><input type="color" name="powerx_header_text" value="<?php echo esc_attr($header_txt); ?>"> <code><?php echo esc_html($header_txt); ?></code></td></tr> <tr><th>Header Link Hover</th><td><input type="color" name="powerx_header_hover" value="<?php echo esc_attr($header_hvr); ?>"> <code><?php echo esc_html($header_hvr); ?></code></td></tr> <tr><th>Top Utility Bar Background</th><td><input type="color" name="powerx_topbar_bg" value="<?php echo esc_attr($topbar_bg); ?>"> <code><?php echo esc_html($topbar_bg); ?></code></td></tr> <tr><th>Top Utility Bar Text</th><td><input type="color" name="powerx_topbar_text" value="<?php echo esc_attr($topbar_txt); ?>"> <code><?php echo esc_html($topbar_txt); ?></code></td></tr> <tr><th>CTA Button Background (Gold/Yellow)</th><td><input type="color" name="powerx_cta_bg" value="<?php echo esc_attr($cta_bg); ?>"> <code><?php echo esc_html($cta_bg); ?></code></td></tr> <tr><th>CTA Button Text</th><td><input type="color" name="powerx_cta_text" value="<?php echo esc_attr($cta_txt); ?>"> <code><?php echo esc_html($cta_txt); ?></code></td></tr> <tr> <th>Font Family</th> <td> <select name="powerx_font_family"> <option value="system-ui, -apple-system, sans-serif" <?php selected($font_fam, 'system-ui, -apple-system, sans-serif'); ?>>System UI (Fast & Crisp)</option> <option value="'Inter', sans-serif" <?php selected($font_fam, "'Inter', sans-serif"); ?>>Inter</option> <option value="'Roboto', sans-serif" <?php selected($font_fam, "'Roboto', sans-serif"); ?>>Roboto</option> <option value="'Outfit', sans-serif" <?php selected($font_fam, "'Outfit', sans-serif"); ?>>Outfit</option> <option value="'Montserrat', sans-serif" <?php selected($font_fam, "'Montserrat', sans-serif"); ?>>Montserrat</option> </select> </td> </tr> </table> </div> <div style="background:#fff; border:1px solid #ccd0d4; padding:20px; margin-bottom:24px; border-radius:8px; max-width:850px;"> <h2>2. Homepage Hero Slider (2 Background Slides)</h2> <h3>Slide 1 (Engines Focus)</h3> <table class="form-table"> <tr><th>Background Image URL</th><td><input type="text" name="slide1_bg" value="<?php echo esc_attr($slide1_bg); ?>" class="regular-text" style="width:100%;"></td></tr> <tr><th>Tagline Pill</th><td><input type="text" name="slide1_pill" value="<?php echo esc_attr($slide1_pill); ?>" class="regular-text" style="width:100%;"></td></tr> <tr><th>H1 Title</th><td><input type="text" name="slide1_h1" value="<?php echo esc_attr($slide1_h1); ?>" class="regular-text" style="width:100%;"></td></tr> <tr><th>Description</th><td><textarea name="slide1_desc" rows="2" style="width:100%;"><?php echo esc_textarea($slide1_desc); ?></textarea></td></tr> </table> <hr style="margin:20px 0; border:0; border-top:1px solid #e2e8f0;"> <h3>Slide 2 (Transmissions Focus)</h3> <table class="form-table"> <tr><th>Background Image URL</th><td><input type="text" name="slide2_bg" value="<?php echo esc_attr($slide2_bg); ?>" class="regular-text" style="width:100%;"></td></tr> <tr><th>Tagline Pill</th><td><input type="text" name="slide2_pill" value="<?php echo esc_attr($slide2_pill); ?>" class="regular-text" style="width:100%;"></td></tr> <tr><th>H1 Title</th><td><input type="text" name="slide2_h1" value="<?php echo esc_attr($slide2_h1); ?>" class="regular-text" style="width:100%;"></td></tr> <tr><th>Description</th><td><textarea name="slide2_desc" rows="2" style="width:100%;"><?php echo esc_textarea($slide2_desc); ?></textarea></td></tr> </table> </div> <div style="background:#fff; border:1px solid #ccd0d4; padding:20px; margin-bottom:24px; border-radius:8px; max-width:850px;"> <h2>3. Quote Form Fields & Dropdown Customization</h2> <table class="form-table"> <tr> <th>Part Types Dropdown</th> <td><textarea name="powerx_form_parts_list" rows="3" style="width:100%;"><?php echo esc_textarea($parts_list); ?></textarea></td> </tr> <tr> <th>Makes Dropdown</th> <td><textarea name="powerx_form_makes_list" rows="3" style="width:100%;"><?php echo esc_textarea($makes_list); ?></textarea></td> </tr> <tr> <th>Year Range</th> <td> From <input type="number" name="powerx_form_start_year" value="<?php echo esc_attr($start_year); ?>" style="width:80px;"> To <input type="number" name="powerx_form_end_year" value="<?php echo esc_attr($end_year); ?>" style="width:80px;"> </td> </tr> </table> </div> <p><input type="submit" name="powerx_save_all" class="button button-primary button-large" value="Save All Theme & Color Settings"></p> </form> </div> <?php } // Strip Legacy Header Code & Auto-inject Hero Slider at Top + FAQ Section at Bottom of EVERY page! add_filter('the_content', function($content) { // STRIP ANY LEGACY HARDCODED HEADER HTML FROM CONTENT TO PREVENT 2 HEADERS ISSUE! $content = preg_replace('/<div id="px-top-utility-bar".*?<\/header>/s', '', $content); $content = preg_replace('/<header style="background: #1E293B.*?<\/header>/s', '', $content); $content = preg_replace('/<header id="px-main-white-header".*?<\/header>/s', '', $content); // Prepend Hero Slider & Quote Form at TOP if missing if (strpos($content, 'px-hero-slider-wrapper') === false && strpos($content, 'powerx-light-form-card') === false) { $hero_html = do_shortcode('[powerx_hero_slider]'); $content = $hero_html . $content; } // Append Page-Specific FAQ Section at BOTTOM if missing if (strpos($content, 'px-faq-list') === false && strpos($content, 'px-faq-item') === false) { $faq_html = powerx_render_bottom_faq_section(); $content .= $faq_html; } return $content; }, 10); // Render Bottom FAQ Section for every page function powerx_render_bottom_faq_section() { ob_start(); ?> <div class="px-section px-section-faq" style="background: #0B132B; padding: 60px 20px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 50px;"> <div style="max-width: 1100px; margin: 0 auto;"> <div style="text-align: center; margin-bottom: 36px;"> <div style="display: inline-block; background: rgba(217,119,6,0.2); color: #F59E0B; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; padding: 5px 14px; border-radius: 50px; text-transform: uppercase; margin-bottom: 10px;"> FREQUENTLY ASKED QUESTIONS </div> <h2 style="font-size: 32px; font-weight: 900; color: #FFFFFF; margin: 0;"> NEED ANSWERS? WE HAVE YOU COVERED </h2> </div> <div class="px-faq-list" style="display: flex; flex-direction: column; gap: 14px;"> <div class="px-faq-item" style="background: #1E293B; border-radius: 10px; border: 1px solid #334155; padding: 18px 22px;"> <div class="px-faq-header" style="font-size: 16px; font-weight: 800; color: #FFFFFF; display: flex; justify-content: space-between; cursor: pointer;"> <span>How are used engines and transmissions tested before shipping?</span> <span style="color: #F59E0B; font-weight: 900;">+</span> </div> <div class="px-faq-body" style="font-size: 14px; color: #94A3B8; margin-top: 10px; line-height: 1.6;"> Every unit undergoes a comprehensive multi-point technical inspection including cylinder compression testing (150-185 PSI across all cylinders), oil pan contamination checks, valve solenoid resistance testing, and VIN fitment verification. </div> </div> <div class="px-faq-item" style="background: #1E293B; border-radius: 10px; border: 1px solid #334155; padding: 18px 22px;"> <div class="px-faq-header" style="font-size: 16px; font-weight: 800; color: #FFFFFF; display: flex; justify-content: space-between; cursor: pointer;"> <span>What warranty coverage is included with my purchase?</span> <span style="color: #F59E0B; font-weight: 900;">+</span> </div> <div class="px-faq-body" style="font-size: 14px; color: #94A3B8; margin-top: 10px; line-height: 1.6;"> We provide up to 100 days standard warranty coverage on all used OEM Engines and Transmissions, and 30 days on body/electrical components. Extended warranty options are also available. </div> </div> <div class="px-faq-item" style="background: #1E293B; border-radius: 10px; border: 1px solid #334155; padding: 18px 22px;"> <div class="px-faq-header" style="font-size: 16px; font-weight: 800; color: #FFFFFF; display: flex; justify-content: space-between; cursor: pointer;"> <span>How fast is freight shipping to my commercial repair shop?</span> <span style="color: #F59E0B; font-weight: 900;">+</span> </div> <div class="px-faq-body" style="font-size: 14px; color: #94A3B8; margin-top: 10px; line-height: 1.6;"> Commercial freight shipping takes 3 to 5 business days nationwide. Free shipping is provided to any commercial address with a loading dock or forklift. </div> </div> <div class="px-faq-item" style="background: #1E293B; border-radius: 10px; border: 1px solid #334155; padding: 18px 22px;"> <div class="px-faq-header" style="font-size: 16px; font-weight: 800; color: #FFFFFF; display: flex; justify-content: space-between; cursor: pointer;"> <span>How do I verify exact fitment for my vehicle VIN?</span> <span style="color: #F59E0B; font-weight: 900;">+</span> </div> <div class="px-faq-body" style="font-size: 14px; color: #94A3B8; margin-top: 10px; line-height: 1.6;"> Provide your 17-digit VIN during checkout or quote request. Our certified technicians cross-reference OEM interchange databases to guarantee 100% VIN fitment before dispatch. </div> </div> </div> </div> </div> <?php return ob_get_clean(); } // Hero Slider with Stationary Persistent Form add_shortcode('powerx_hero_slider', 'powerx_render_hero_slider_shortcode'); function powerx_render_hero_slider_shortcode($atts = array()) { $slides = get_option('powerx_hero_slides_data', array()); $slide1_bg = !empty($slides[1]['bg']) ? $slides[1]['bg'] : 'https://images.unsplash.com/photo-1580273916550-e323be2ae537?auto=format&fit=crop&w=1600&q=80'; $slide1_pill = !empty($slides[1]['pill']) ? $slides[1]['pill'] : 'QUALITY USED OEM AUTOMOTIVE COMPONENTS'; $slide1_h1 = !empty($slides[1]['h1']) ? $slides[1]['h1'] : 'Used Engines for Sale | High Performance & Low Mileage'; $slide1_desc = !empty($slides[1]['desc']) ? $slides[1]['desc'] : 'Tested, certified used OEM engines with up to 100-day warranty coverage. Tested compression & nationwide fast delivery.'; $slide2_bg = !empty($slides[2]['bg']) ? $slides[2]['bg'] : 'https://images.unsplash.com/photo-1486006920555-c77dce18193b?auto=format&fit=crop&w=1600&q=80'; $slide2_pill = !empty($slides[2]['pill']) ? $slides[2]['pill'] : 'QUALITY USED OEM AUTOMOTIVE COMPONENTS'; $slide2_h1 = !empty($slides[2]['h1']) ? $slides[2]['h1'] : 'Used Transmissions for Sale | Automatic, Manual & CVT'; $slide2_desc = !empty($slides[2]['desc']) ? $slides[2]['desc'] : 'Quality used OEM transmissions matched to your VIN. Automatic, manual and CVT units with multiple mileage options and warranty coverage.'; ob_start(); ?> <div class="px-hero-slider-wrapper" style="position: relative; width: 100%; min-height: 640px; background: #0B132B; overflow: hidden; margin-bottom: 30px;"> <div class="px-bg-slide px-bg-active" data-index="0" style="position: absolute; inset: 0; opacity: 1; transition: opacity 0.8s ease-in-out; background: linear-gradient(90deg, rgba(11,19,43,0.95) 0%, rgba(11,19,43,0.85) 50%, rgba(11,19,43,0.5) 100%), url('<?php echo esc_url($slide1_bg); ?>') center/cover no-repeat;"></div> <div class="px-bg-slide" data-index="1" style="position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease-in-out; background: linear-gradient(90deg, rgba(11,19,43,0.95) 0%, rgba(11,19,43,0.85) 50%, rgba(11,19,43,0.5) 100%), url('<?php echo esc_url($slide2_bg); ?>') center/cover no-repeat;"></div> <div style="position: relative; z-index: 5; max-width: 1280px; margin: 0 auto; padding: 24px 20px; display: grid; grid-template-columns: 1fr 460px; gap: 32px; align-items: center; min-height: 640px;"> <div style="position: relative; max-width: 640px; min-height: 360px; display: flex; align-items: center;"> <div class="px-text-slide px-text-active" data-index="0" style="position: absolute; inset: 0; opacity: 1; transition: opacity 0.8s ease-in-out; display: flex; flex-direction: column; justify-content: center;"> <div style="display: inline-block; width: fit-content; background: rgba(217,119,6,0.25); border: 1px solid rgba(245,158,11,0.5); color: #FBBF24; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; padding: 6px 16px; border-radius: 50px; text-transform: uppercase; margin-bottom: 18px;"> <?php echo esc_html($slide1_pill); ?> </div> <h1 style="color: #FFFFFF; font-size: 38px; font-weight: 900; line-height: 1.15; margin-bottom: 16px; letter-spacing: -0.5px;"> <?php echo esc_html($slide1_h1); ?> </h1> <p style="color: #94A3B8; font-size: 15px; line-height: 1.6; margin-bottom: 24px;"> <?php echo esc_html($slide1_desc); ?> </p> <div style="display: flex; gap: 10px; flex-wrap: wrap;"> <span style="background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #F1F5F9; padding: 7px 12px; border-radius: 30px; font-size: 11.5px; font-weight: 700;">✓ 100% VIN Fitment Guarantee</span> <span style="background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #F1F5F9; padding: 7px 12px; border-radius: 30px; font-size: 11.5px; font-weight: 700;">✓ Warranty Protection</span> <span style="background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #F1F5F9; padding: 7px 12px; border-radius: 30px; font-size: 11.5px; font-weight: 700;">✓ Free Commercial Shipping</span> </div> </div> <div class="px-text-slide" data-index="1" style="position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 0.8s ease-in-out; display: flex; flex-direction: column; justify-content: center;"> <div style="display: inline-block; width: fit-content; background: rgba(217,119,6,0.25); border: 1px solid rgba(245,158,11,0.5); color: #FBBF24; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; padding: 6px 16px; border-radius: 50px; text-transform: uppercase; margin-bottom: 18px;"> <?php echo esc_html($slide2_pill); ?> </div> <h1 style="color: #FFFFFF; font-size: 38px; font-weight: 900; line-height: 1.15; margin-bottom: 16px; letter-spacing: -0.5px;"> <?php echo esc_html($slide2_h1); ?> </h1> <p style="color: #94A3B8; font-size: 15px; line-height: 1.6; margin-bottom: 24px;"> <?php echo esc_html($slide2_desc); ?> </p> <div style="display: flex; gap: 10px; flex-wrap: wrap;"> <span style="background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #F1F5F9; padding: 7px 12px; border-radius: 30px; font-size: 11.5px; font-weight: 700;">✓ 100% VIN Fitment Guarantee</span> <span style="background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #F1F5F9; padding: 7px 12px; border-radius: 30px; font-size: 11.5px; font-weight: 700;">✓ Warranty Protection</span> <span style="background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #F1F5F9; padding: 7px 12px; border-radius: 30px; font-size: 11.5px; font-weight: 700;">✓ Free Commercial Shipping</span> </div> </div> </div> <div style="position: relative; z-index: 10;"> <?php echo do_shortcode('[powerx_quote_form]'); ?> </div> </div> <div style="position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; gap: 8px;"> <span class="px-dot px-dot-active" onclick="powerxGoSlide(0)" style="width: 28px; height: 8px; border-radius: 4px; background: #D97706; cursor: pointer; transition: all 0.3s;"></span> <span class="px-dot" onclick="powerxGoSlide(1)" style="width: 10px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.4); cursor: pointer; transition: all 0.3s;"></span> </div> </div> <script> let currentPXSlide = 0; const pxBgSlides = document.querySelectorAll('.px-bg-slide'); const pxTextSlides = document.querySelectorAll('.px-text-slide'); const pxDots = document.querySelectorAll('.px-dot'); function powerxShowSlide(index) { pxBgSlides.forEach((slide, idx) => { slide.style.opacity = (idx === index) ? '1' : '0'; }); pxTextSlides.forEach((slide, idx) => { if (idx === index) { slide.style.opacity = '1'; slide.style.pointerEvents = 'auto'; } else { slide.style.opacity = '0'; slide.style.pointerEvents = 'none'; } }); pxDots.forEach((dot, idx) => { if (idx === index) { dot.style.width = '28px'; dot.style.background = 'var(--px-primary, #D97706)'; } else { dot.style.width = '10px'; dot.style.background = 'rgba(255,255,255,0.4)'; } }); currentPXSlide = index; } function powerxNextSlide() { let next = (currentPXSlide + 1) % pxBgSlides.length; powerxShowSlide(next); } function powerxGoSlide(idx) { powerxShowSlide(idx); } setInterval(powerxNextSlide, 6000); </script> <style> @media (max-width: 991px) { .px-hero-slider-wrapper > div { grid-template-columns: 1fr !important; } .px-hero-slider-wrapper { min-height: auto !important; height: auto !important; } } </style> <?php return ob_get_clean(); } // Unified Light Quote Form Shortcode add_shortcode('powerx_quote_form', 'powerx_render_quote_form'); add_shortcode('automotive_lead_form', 'powerx_render_quote_form'); function powerx_render_quote_form($atts = array()) { $a = shortcode_atts(array( 'title' => 'FIND THE RIGHT PART FOR YOUR VEHICLE', 'subtitle' => 'Select your Year, Make, Model, and Part Type to receive compatible options and pricing.', 'button_text' => 'GET MY PART OPTIONS' ), $atts); $raw_parts = get_option('powerx_form_parts_list', "Engine, Transmission, Reman Engine, Used Engine, Used Transmission, Transfer Case"); $parts_arr = array_map('trim', explode(',', $raw_parts)); $raw_makes = get_option('powerx_form_makes_list', "Acura, Audi, BMW, Chevrolet, Dodge, Ford, GMC, Honda, Hyundai, Jeep, Nissan, Toyota, RAM, Subaru, Volkswagen, Volvo"); $makes_arr = array_map('trim', explode(',', $raw_makes)); $start_year = get_option('powerx_form_start_year', 1990); $end_year = get_option('powerx_form_end_year', 2026); ob_start(); ?> <div class="powerx-light-form-card" style="background: #FFFFFF; border-radius: 14px; padding: 20px; box-shadow: 0 16px 36px rgba(0,0,0,0.18); max-width: 460px; width: 100%; border: 1px solid #E2E8F0; font-family: system-ui, -apple-system, sans-serif;"> <h3 style="font-size: 18px; font-weight: 900; color: #0F172A; text-transform: uppercase; margin-bottom: 4px; letter-spacing: -0.2px; text-align: center;"> <?php echo esc_html($a['title']); ?> </h3> <p style="font-size: 12px; color: #64748B; margin-bottom: 14px; line-height: 1.35; text-align: center;"> <?php echo esc_html($a['subtitle']); ?> </p> <form action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="POST"> <input type="hidden" name="action" value="powerx_submit_lead"> <?php wp_nonce_field('powerx_lead_nonce', '_wpnonce'); ?> <div style="margin-bottom: 9px;"> <label style="display: block; font-size: 10.5px; font-weight: 800; color: #334155; text-transform: uppercase; margin-bottom: 3px; letter-spacing: 0.5px;">WHICH PART? *</label> <select name="part_type" required style="width: 100%; height: 38px; background: #F8FAFC; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0 10px; font-size: 13px; color: #0F172A; font-weight: 600;"> <?php foreach($parts_arr as $p): ?> <option value="<?php echo esc_attr($p); ?>" <?php selected($p, 'Transmission'); ?>><?php echo esc_html($p); ?></option> <?php endforeach; ?> </select> </div> <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 9px;"> <div> <label style="display: block; font-size: 10.5px; font-weight: 800; color: #334155; text-transform: uppercase; margin-bottom: 3px; letter-spacing: 0.5px;">WHICH MAKE? *</label> <select name="make" required style="width: 100%; height: 38px; background: #F8FAFC; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0 10px; font-size: 13px; color: #0F172A;"> <option value="">Select Make</option> <?php foreach($makes_arr as $mk): ?> <option value="<?php echo esc_attr($mk); ?>"><?php echo esc_html($mk); ?></option> <?php endforeach; ?> </select> </div> <div> <label style="display: block; font-size: 10.5px; font-weight: 800; color: #334155; text-transform: uppercase; margin-bottom: 3px; letter-spacing: 0.5px;">WHICH MODEL? *</label> <input type="text" name="model" placeholder="e.g. Camry, F-150" required style="width: 100%; height: 38px; background: #F8FAFC; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0 10px; font-size: 13px; color: #0F172A;"> </div> </div> <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 9px;"> <div> <label style="display: block; font-size: 10.5px; font-weight: 800; color: #334155; text-transform: uppercase; margin-bottom: 3px; letter-spacing: 0.5px;">WHICH YEAR? *</label> <select name="year" required style="width: 100%; height: 38px; background: #F8FAFC; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0 10px; font-size: 13px; color: #0F172A;"> <option value="">Select Year</option> <?php for($y = $end_year; $y >= $start_year; $y--): ?> <option value="<?php echo $y; ?>"><?php echo $y; ?></option> <?php endfor; ?> </select> </div> <div> <label style="display: block; font-size: 10.5px; font-weight: 800; color: #334155; text-transform: uppercase; margin-bottom: 3px; letter-spacing: 0.5px;">WHICH VARIANT?</label> <input type="text" name="variant" placeholder="e.g. 2.5L 4-Cyl" style="width: 100%; height: 38px; background: #F8FAFC; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0 10px; font-size: 13px; color: #0F172A;"> </div> </div> <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 9px;"> <div> <label style="display: block; font-size: 10.5px; font-weight: 800; color: #334155; text-transform: uppercase; margin-bottom: 3px; letter-spacing: 0.5px;">NAME *</label> <input type="text" name="full_name" placeholder="Your full name" required style="width: 100%; height: 38px; background: #F8FAFC; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0 10px; font-size: 13px; color: #0F172A;"> </div> <div> <label style="display: block; font-size: 10.5px; font-weight: 800; color: #334155; text-transform: uppercase; margin-bottom: 3px; letter-spacing: 0.5px;">EMAIL *</label> <input type="email" name="email" placeholder="Your email address" required style="width: 100%; height: 38px; background: #F8FAFC; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0 10px; font-size: 13px; color: #0F172A;"> </div> </div> <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 9px;"> <div> <label style="display: block; font-size: 10.5px; font-weight: 800; color: #334155; text-transform: uppercase; margin-bottom: 3px; letter-spacing: 0.5px;">PHONE *</label> <input type="tel" name="phone" placeholder="Your contact number" required style="width: 100%; height: 38px; background: #F8FAFC; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0 10px; font-size: 13px; color: #0F172A;"> </div> <div> <label style="display: block; font-size: 10.5px; font-weight: 800; color: #334155; text-transform: uppercase; margin-bottom: 3px; letter-spacing: 0.5px;">VIN (OPTIONAL)</label> <input type="text" name="vin" placeholder="17-digit VIN" style="width: 100%; height: 38px; background: #F8FAFC; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0 10px; font-size: 13px; color: #0F172A;"> </div> </div> <div style="margin-bottom: 10px; display: flex; gap: 6px; align-items: flex-start;"> <input type="checkbox" name="opt_in" id="opt_in_cb" value="1" required checked style="margin-top: 2px;"> <label for="opt_in_cb" style="font-size: 10px; color: #64748B; line-height: 1.3;"> By checking this box you agree to receive recurring messages from PowerX Auto Parts. Reply STOP to opt out. </label> </div> <button type="submit" style="width: 100%; background: linear-gradient(135deg, var(--px-primary, #D97706) 0%, #B45309 100%); color: #FFFFFF; font-weight: 900; font-size: 14px; letter-spacing: 0.5px; text-transform: uppercase; border: none; border-radius: 6px; padding: 12px 16px; cursor: pointer; box-shadow: 0 4px 12px rgba(217,119,6,0.35);"> <?php echo esc_html($a['button_text']); ?> </button> <div style="display: flex; justify-content: space-between; gap: 4px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #E2E8F0; flex-wrap: wrap;"> <span style="font-size: 10px; font-weight: 700; color: #475569;">✓ 100% VIN Match</span> <span style="font-size: 10px; font-weight: 700; color: #475569;">✓ Fast Response</span> <span style="font-size: 10px; font-weight: 700; color: #475569;">✓ Free Shipping</span> <span style="font-size: 10px; font-weight: 700; color: #475569;">✓ 24/7 Support</span> </div> </form> </div> <?php return ob_get_clean(); } // Single Header Renderer add_action('wp_body_open', 'powerx_render_single_unified_header'); add_action('wp_footer', 'powerx_render_mobile_drawer_and_modal'); function powerx_render_single_unified_header() { ?> <!-- Top Utility Bar (Matching Reference Mockup!) --> <div id="px-top-utility-bar" style="background: var(--px-topbar-bg, #0F172A); color: var(--px-topbar-text, #CBD5E1); font-size: 12px; font-weight: 600; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.08);"> <div style="max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;"> <div style="display: flex; gap: 20px; align-items: center; flex-wrap: wrap;"> <span>📍 Houston, Texas, USA</span> <span>🚚 Quality Used Auto Parts</span> <span>🛡️ Trusted & Reliable</span> </div> <div style="display: flex; gap: 20px; align-items: center;"> <a href="tel:+18325550123" style="color: var(--px-topbar-text, #CBD5E1); text-decoration: none;">📞 +1 (832) 555-0123</a> <a href="mailto:sales@powerxautoparts.com" style="color: var(--px-topbar-text, #CBD5E1); text-decoration: none;">✉️ sales@powerxautoparts.com</a> </div> </div> </div> <!-- Main White Header Bar (Matching Reference Mockup!) --> <header id="px-main-white-header" style="background: var(--px-header-bg, #FFFFFF); border-bottom: 1px solid #E2E8F0; position: sticky; top: 0; z-index: 99999; box-shadow: 0 4px 16px rgba(0,0,0,0.06);"> <div style="max-width: 1280px; margin: 0 auto; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center;"> <!-- Logo --> <a href="<?php echo esc_url(home_url('/')); ?>" style="display: flex; align-items: center; text-decoration: none;"> <img src="https://scribes.in/wp-content/uploads/2026/09/powerx_header_logo_v2.png" alt="PowerX Auto Parts" style="max-height: 44px; width: auto; display: block;"> </a> <!-- Desktop Links --> <nav class="px-desktop-menu" style="display: flex; align-items: center; gap: 28px;"> <?php echo powerx_get_header_nav_html(); ?> </nav> <!-- CTA Call Button + Mobile Toggle Button --> <div style="display: flex; gap: 12px; align-items: center;"> <a href="tel:+18325550123" class="px-gold-cta-btn" style="display: inline-flex; align-items: center; gap: 8px; background: var(--px-cta-bg, #D97706); color: var(--px-cta-text, #FFFFFF); font-weight: 800; font-size: 14px; padding: 11px 22px; border-radius: 8px; text-decoration: none; box-shadow: 0 4px 14px rgba(217,119,6,0.3); transition: transform 0.2s;"> 📞 Call Us </a> <button onclick="document.getElementById('px-mobile-drawer').style.display='flex'" class="px-mobile-toggle" style="display: none; background: #F1F5F9; border: 1px solid #CBD5E1; color: #0F172A; font-size: 22px; padding: 8px 14px; border-radius: 8px; cursor: pointer; align-items: center; justify-content: center;"> ☰ </button> </div> </div> </header> <?php } function powerx_get_header_nav_html() { $home = home_url('/'); $engines = home_url('/engines/'); $trans = home_url('/transmissions/'); $about = home_url('/about-us/'); $contact = home_url('/contact-us/'); $menu_html = '<ul class="px-header-dynamic-menu-list">' . '<li><a href="' . $home . '">Home</a></li>' . '<li><a href="' . $engines . '">Engines</a></li>' . '<li><a href="' . $trans . '">Transmissions</a></li>' . '<li><a href="' . $about . '">About Us</a></li>' . '<li><a href="' . $contact . '">Contact Us</a></li>' . '</ul>'; return $menu_html; } function powerx_render_mobile_drawer_and_modal() { $home = home_url('/'); $engines = home_url('/engines/'); $trans = home_url('/transmissions/'); $about = home_url('/about-us/'); $contact = home_url('/contact-us/'); ?> <!-- Mobile Drawer Overlay (White Panel 1:1 Matching Mockup Image!) --> <div id="px-mobile-drawer" style="position: fixed; inset: 0; background: #FFFFFF; z-index: 999999; display: none; flex-direction: column; padding: 20px; font-family: system-ui, -apple-system, sans-serif; overflow-y: auto;"> <div style="display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 1px solid #E2E8F0; margin-bottom: 20px;"> <a href="<?php echo esc_url($home); ?>"> <img src="https://scribes.in/wp-content/uploads/2026/09/powerx_header_logo_v2.png" alt="PowerX Auto Parts" style="max-height: 38px; width: auto;"> </a> <div style="display: flex; gap: 10px; align-items: center;"> <a href="tel:+18325550123" class="px-gold-cta-btn" style="background: var(--px-cta-bg, #D97706); color: #FFFFFF; font-weight: 800; font-size: 13px; padding: 8px 16px; border-radius: 8px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;"> 📞 Call Us </a> <button onclick="document.getElementById('px-mobile-drawer').style.display='none'" style="background: #F1F5F9; border: 1px solid #CBD5E1; color: #0F172A; font-size: 24px; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1;"> ✕ </button> </div> </div> <nav style="margin-bottom: 30px;"> <ul class="px-mobile-drawer-menu-list"> <li> <a href="<?php echo esc_url($home); ?>" class="active"> <span style="display: flex; align-items: center; gap: 12px;"> <span style="font-size: 18px;">🏠</span> Home </span> </a> </li> <li> <a href="<?php echo esc_url($engines); ?>"> <span style="display: flex; align-items: center; gap: 12px;"> <span style="font-size: 18px;">⚙️</span> Engines </span> <span style="font-size: 14px; color: #64748B;">›</span> </a> </li> <li> <a href="<?php echo esc_url($trans); ?>"> <span style="display: flex; align-items: center; gap: 12px;"> <span style="font-size: 18px;">⚙️</span> Transmissions </span> <span style="font-size: 14px; color: #64748B;">›</span> </a> </li> <li> <a href="<?php echo esc_url($about); ?>"> <span style="display: flex; align-items: center; gap: 12px;"> <span style="font-size: 18px;">👥</span> About Us </span> <span style="font-size: 14px; color: #64748B;">›</span> </a> </li> <li> <a href="<?php echo esc_url($contact); ?>"> <span style="display: flex; align-items: center; gap: 12px;"> <span style="font-size: 18px;">📞</span> Contact Us </span> <span style="font-size: 14px; color: #64748B;">›</span> </a> </li> </ul> </nav> <div style="margin-top: auto; padding-top: 20px; border-top: 1px solid #E2E8F0; display: flex; flex-direction: column; gap: 14px;"> <a href="tel:+18325550123" style="color: #0F172A; font-weight: 700; font-size: 15px; text-decoration: none; display: flex; align-items: center; gap: 10px;"> <span style="color: #D97706; font-size: 18px;">📞</span> +1 (832) 555-0123 </a> <a href="mailto:sales@powerxautoparts.com" style="color: #0F172A; font-weight: 700; font-size: 15px; text-decoration: none; display: flex; align-items: center; gap: 10px;"> <span style="color: #D97706; font-size: 18px;">✉️</span> sales@powerxautoparts.com </a> <div style="color: #0F172A; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 10px;"> <span style="color: #D97706; font-size: 18px;">📍</span> Houston, Texas, USA </div> <div style="display: flex; gap: 12px; margin-top: 10px;"> <a href="#" style="width: 40px; height: 40px; border-radius: 50%; background: #D97706; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 900; text-decoration: none; font-size: 16px;">f</a> <a href="#" style="width: 40px; height: 40px; border-radius: 50%; background: #D97706; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 900; text-decoration: none; font-size: 16px;">📷</a> <a href="#" style="width: 40px; height: 40px; border-radius: 50%; background: #D97706; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 900; text-decoration: none; font-size: 16px;">▶</a> </div> </div> </div> <!-- Quote Modal --> <div id="powerx-quote-modal" style="position: fixed; inset: 0; background: rgba(15,23,42,0.85); backdrop-filter: blur(8px); z-index: 9999999; display: none; align-items: center; justify-content: center; padding: 20px;"> <div style="position: relative; max-width: 480px; width: 100%;"> <button onclick="document.getElementById('powerx-quote-modal').style.display='none'" style="position: absolute; top: -14px; right: -14px; width: 36px; height: 36px; border-radius: 50%; background: #D97706; color: #FFF; border: none; font-size: 20px; font-weight: 900; cursor: pointer; z-index: 1000; box-shadow: 0 4px 12px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center;"> ✕ </button> <?php echo do_shortcode('[powerx_quote_form title="GET AN INSTANT PRICE QUOTE" subtitle="Fill out the form below to receive immediate availability & pricing for your vehicle."]'); ?> </div> </div> <?php } // Database Clean Filter add_action('init', function() { if (isset($_GET['px_clean_legacy_content'])) { global $wpdb; $posts = $wpdb->get_results("SELECT ID, post_content FROM {$wpdb->posts} WHERE post_content LIKE '%<header%' OR post_content LIKE '%px-top-utility-bar%'"); if (!empty($posts)) { foreach ($posts as $p) { $cleaned = preg_replace('/<div id="px-top-utility-bar".*?<\/header>/s', '', $p->post_content); $cleaned = preg_replace('/<header style="background: #1E293B.*?<\/header>/s', '', $cleaned); $cleaned = preg_replace('/<header id="px-main-white-header".*?<\/header>/s', '', $cleaned); if ($cleaned !== $p->post_content) { $wpdb->update($wpdb->posts, array('post_content' => $cleaned), array('ID' => $p->ID)); } } } powerx_clear_all_caches(); } });