<?php /** * Polished Blog functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package Polished Blog */ add_theme_support( 'title-tag' ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'register_block_style' ); add_theme_support( 'register_block_pattern' ); add_theme_support( 'responsive-embeds' ); add_theme_support( 'wp-block-styles' ); add_theme_support( 'align-wide' ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script', ) ); add_theme_support( 'custom-logo', array( 'height' => 250, 'width' => 250, 'flex-width' => true, 'flex-height' => true, ) ); if ( ! function_exists( 'polished_blog_setup' ) ) : function polished_blog_setup() { /* * Make child theme available for translation. * Translations can be filed in the /languages/ directory. */ load_child_theme_textdomain( 'polished-blog', get_stylesheet_directory() . '/languages' ); } // Set up the WordPress core custom background feature. /* add_theme_support( 'custom-background', apply_filters( 'polished_blog_custom_background_args', array( 'default-color' => 'fffdec', 'default-image' => '', ) ) );*/ endif; add_action( 'after_setup_theme', 'polished_blog_setup' ); if ( ! function_exists( 'polished_blog_enqueue_styles' ) ) : /** * Enqueue scripts and styles. */ function polished_blog_enqueue_styles() { $parenthandle = 'glowing-blog-style'; $theme = wp_get_theme(); wp_enqueue_style( $parenthandle, get_template_directory_uri() . '/style.css', array( 'glowing-blog-fonts', 'glowing-blog-slick-style', 'glowing-blog-fontawesome-style', 'glowing-blog-blocks-style', ), $theme->parent()->get( 'Version' ) ); wp_enqueue_style( 'polished-blog-style', get_stylesheet_uri(), array( $parenthandle ), $theme->get( 'Version' ) ); wp_enqueue_script( 'polished-blog-custom-script', get_stylesheet_directory_uri() . '/assets/js/custom.min.js', array( 'jquery', 'glowing-blog-custom-script' ), $theme->get( 'Version' ), true ); } endif; add_action( 'wp_enqueue_scripts', 'polished_blog_enqueue_styles' ); require get_theme_file_path() . '/inc/customizer/customizer.php'; /** * Adds custom classes to the array of body classes. * * @param array $classes Classes for the body element. * @return array */ function polished_blog_body_classes( $classes ) { // added class for floating header. $classes[] = 'floating-header'; return $classes; } add_filter( 'body_class', 'polished_blog_body_classes' ); /** * Pagination for archive. */ function polished_blog_render_posts_pagination() { $is_pagination_enabled = get_theme_mod( 'glowing_blog_pagination_enable', true ); if ( $is_pagination_enabled ) { $pagination_type = get_theme_mod( 'polished_blog_pagination_type', 'numeric' ); if ( 'default' === $pagination_type ) : the_posts_navigation(); else : the_posts_pagination(); endif; } } add_action( 'polished_blog_posts_pagination', 'polished_blog_render_posts_pagination', 10 ); function polished_blog_load_custom_wp_admin_style() { ?> <style type="text/css"> .ocdi p.demo-data-download-link { display: none !important; } </style> <?php } add_action( 'admin_enqueue_scripts', 'polished_blog_load_custom_wp_admin_style' ); // Style for demo data download link function polished_blog_admin_panel_demo_data_download_link() { ?> <style type="text/css"> p.polished-blog-demo-data { font-size: 16px; font-weight: 700; display: inline-block; border: 0.5px solid #dfdfdf; padding: 8px; background: #ffff; } </style> <?php } add_action( 'admin_enqueue_scripts', 'polished_blog_admin_panel_demo_data_download_link' ); // One Click Demo Import after import setup. if ( class_exists( 'OCDI_Plugin' ) ) { require get_theme_file_path() . '/inc/demo-import.php'; } // Force noindex for specific doorway-page location posts to clean SEO cannibalization add_filter( 'wpseo_robots', function( $robots ) { if ( is_single() && in_array( get_the_ID(), array( 1864, 1702, 2166, 2168, 1798, 1718, 1716, 1710, 1712, 1680, 1692, 1677, 1641, 1601, 1628, 1579) ) ) { return 'noindex, follow'; } return $robots; } ); // Exclude doorway location posts from Yoast sitemap (already noindex via wpseo_robots) add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', function( $posts ) { return array_unique( array_merge( (array) $posts, array( 1864, 1702, 2166, 2168, 1798, 1718, 1716, 1710, 1712, 1680, 1692, 1677, 1641, 1601, 1628, 1579) ) ); } ); // SEO redirect: old price page to main price guide add_action( 'template_redirect', function() { if ( isset( $_SERVER['REQUEST_URI'] ) && strtok( $_SERVER['REQUEST_URI'], '?' ) === '/harga-kubah-masjid/' ) { wp_safe_redirect( home_url( '/daftar-harga-kubah-masjid/' ), 301 ); exit; } }, 1 ); // Fix Kalkulator Kubah formulas via output buffer add_action('template_redirect', function() { ob_start(function($h) { return str_replace( array('fieldname4*1930000', 'fieldname4*3120000', 'fieldname4*3400000', '"Kubah Stainless"', '"Kubah Enamel / Titanium"'), array('fieldname4*1800000', 'fieldname4*2000000', 'fieldname4*2500000', '"Kubah Stainless Gold"', '"Kubah Enamel"'), $h ); }); }); // Fix Kalkulator Kubah formulas via output buffer add_action('template_redirect', function() { ob_start(function($h) { return str_replace( array('fieldname4*1930000', 'fieldname4*3120000', 'fieldname4*3400000', 'Kubah Enamel \/ Titanium'), array('fieldname4*1800000', 'fieldname4*2000000', 'fieldname4*2500000', 'Kubah Enamel'), $h ); }); }); // CSS khusus halaman kalkulator add_action('wp_head', function() { if (!is_singular('post') || get_the_ID() !== 901) return; ?> <style> .qk-page{max-width:1120px;margin:0 auto;font-family:inherit;color:#172018} .qk-hero{background:radial-gradient(circle at top right,rgba(240,199,102,.3),transparent 40%),linear-gradient(135deg,#172018,#2e442b);color:#fff;border-radius:28px;padding:38px 34px;margin:0 auto 30px;box-shadow:0 20px 50px rgba(23,32,24,.15)} .qk-hero h1{margin:0 0 8px;font-size:clamp(28px,4vw,44px)!important;line-height:1.1;color:#fff!important;border:0!important;padding:0!important} .qk-hero p{color:#f8efd8;font-size:17px;max-width:800px;margin:0 0 16px;line-height:1.6} .qk-hero-actions{display:flex;flex-wrap:wrap;gap:12px} .qk-btn{display:inline-flex;align-items:center;justify-content:center;padding:14px 20px;border-radius:999px;background:linear-gradient(135deg,#c9962d,#f0c766);color:#172018!important;font-weight:800;font-size:15px;text-decoration:none!important;box-shadow:0 8px 24px rgba(201,150,45,.28)} .qk-btn:hover{box-shadow:0 12px 32px rgba(201,150,45,.38)} .qk-social{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0} .qk-social{display:flex;flex-wrap:wrap;gap:12px;margin:24px 0;align-items:center} .qk-social .elementor-button-wrapper{margin:0!important} .qk-social .elementor-button{display:inline-flex!important;align-items:center!important;gap:8px;padding:12px 20px!important;border-radius:12px!important;font-weight:700!important;text-decoration:none!important;font-size:14px!important;min-width:130px;justify-content:center!important;box-shadow:0 6px 16px rgba(0,0,0,.08)!important;transition:all .2s!important} .qk-social .elementor-button:hover{transform:translateY(-2px)!important;box-shadow:0 10px 24px rgba(0,0,0,.12)!important} .qk-social a[href*="wa.me"]{background:#25D366!important;color:#fff!important;border:none!important} .qk-social a[href*="wa.me"]:hover{background:#1da851!important} .qk-social a[href*="facebook.com"]{background:#1877F2!important;color:#fff!important;border:none!important} .qk-social a[href*="facebook.com"]:hover{background:#166fe5!important} .qk-social a[href*="instagram.com"]{background:linear-gradient(135deg,#f58529,#dd2a7b,#8134af)!important;color:#fff!important;border:none!important} .qk-social a[href*="instagram.com"]:hover{opacity:.9!important} .qk-social a.qk-wa{border-color:#25d366;background:#f0fff4} .qk-social a.qk-fb{border-color:#1877f2;background:#f0f6ff} .qk-social a.qk-ig{border:2px solid;border-image:linear-gradient(135deg,#f58529,#dd2a7b,#8134af,#515bd4)1} .qk-page h2{font-size:clamp(22px,2.8vw,30px);margin-top:38px;margin-bottom:14px;padding-left:16px;border-left:5px solid #c9962d;line-height:1.22;color:#142016} .qk-page h3{font-size:clamp(18px,2vw,22px);margin-top:26px;margin-bottom:8px;color:#1c2b1f} .qk-page p{font-size:16px;line-height:1.7;color:#334238;margin-bottom:14px} .qk-page ul{background:#fffaf0;border:1px solid #ead9ae;border-radius:16px;padding:20px 24px 20px 46px} .qk-page li{margin:7px 0;line-height:1.6} .qk-page img{border-radius:16px;max-width:100%;height:auto} @media(max-width:780px){.qk-hero{padding:26px 20px;border-radius:22px}} </style> <?php }); // JS untuk styling kalkulator add_action('wp_footer', function() { if (!is_singular('post') || get_the_ID() !== 901) return; ?> <script> document.addEventListener('DOMContentLoaded', function(){ // Wrap hero var hero = document.querySelector('.elementor-widget-theme-post-content'); if(!hero||!hero.querySelector)return; var h=hero.querySelector('h1'); if(h){var he=h.closest('.elementor-widget-container'); if(he&&!he.closest('.qk-hero')){he.classList.add('qk-hero');}} // Style Buka Kalkulator link var bk = hero.querySelector('a[href="#calc"]'); if(bk){bk.classList.add('qk-btn');bk.textContent='→ Buka Kalkulator';} // Style social links var wa = hero.querySelector('a[href*="wa.me/6281249830102"]'); var fb = hero.querySelector('a[href*="facebook.com"]'); var ig = hero.querySelector('a[href*="instagram.com"]'); if(wa||fb||ig){ var wrap=document.createElement('div'); wrap.className='qk-social'; if(wa){wa.classList.add('qk-wa');wrap.appendChild(wa.cloneNode(true));wa.parentNode.replaceChild(wrap,wa);} if(fb){fb.classList.add('qk-fb');wrap.querySelector('.qk-social')?wrap.querySelector('.qk-social').after(fb):wa.after(fb);} if(ig){ig.classList.add('qk-ig');fb?fb.after(ig):wa.after(ig);} } } }); </script> <?php }); https://qoobah.id/post-sitemap.xml 2026-07-24T02:40:12+00:00 https://qoobah.id/page-sitemap.xml 2026-07-23T06:27:41+00:00