#i', // '', // $html // ); // $html = preg_replace( // '##i', // '', // $html // ); // return $html; // } ); // } // add_action( 'wp_head', 'ak_opta_child_force_og_image_in_head', 1 ); /** * Confirmed from opta-wp/style.css — the preloader uses class * '.doc-loader' (full-screen, fixed, z-index 99999, white background). * Override is now baked into style.css; no inline injection needed. */ /* ═══════════════════════════════════════════════════════════════ * AEO (Answer Engine Optimization) — Schema Injection * ─────────────────────────────────────────────────────────────── * Auto-injects structured data (JSON-LD) on blog posts and pages * so AI answer engines (ChatGPT, Perplexity, Google AI Overviews) * can extract, cite, and surface your content. * * Three schemas are injected: * 1. BlogPosting — every single post * 2. FAQPage — posts containing FAQ sections (auto-detected) * 3. BreadcrumbList — all posts and non-front pages * * IMPORTANT: If AIOSEO is also outputting Article schema, disable * it first: AIOSEO → Search Appearance → Content Types → Posts → * Schema Markup → set to "None" to avoid duplicates. * ═══════════════════════════════════════════════════════════════ */ // ── 1. BlogPosting Schema (all single posts) ────────────────── add_action( 'wp_head', 'ak_inject_blogposting_schema', 5 ); function ak_inject_blogposting_schema() { if ( ! is_single() ) return; global $post; $pub = get_the_date( 'c', $post ); $mod = get_the_modified_date( 'c', $post ); $excerpt = wp_strip_all_tags( get_the_excerpt( $post ) ); $thumb = get_the_post_thumbnail_url( $post, 'full' ); $cats = wp_get_post_categories( $post->ID, array( 'fields' => 'names' ) ); $tags = wp_get_post_tags( $post->ID, array( 'fields' => 'names' ) ); $word_count = str_word_count( wp_strip_all_tags( $post->post_content ) ); // Fallback image if no featured image set if ( ! $thumb ) { $thumb = 'https://abhilashkrishnan.com/assets/abhilash-krishan-real.png'; } $schema = array( '@context' => 'https://schema.org', '@type' => 'BlogPosting', 'mainEntityOfPage' => array( '@type' => 'WebPage', '@id' => get_permalink( $post ), ), 'headline' => get_the_title( $post ), 'description' => $excerpt, 'image' => $thumb, 'datePublished' => $pub, 'dateModified' => $mod, 'wordCount' => $word_count, 'author' => array( '@type' => 'Person', 'name' => 'Abhilash Krishnan', 'url' => 'https://abhilashkrishnan.com', 'jobTitle' => 'Creative Director & Thought Leader', 'sameAs' => array( 'https://www.linkedin.com/in/abhilashkrishnan/', 'https://twitter.com/freezebyte', ), ), 'publisher' => array( '@type' => 'Person', 'name' => 'Abhilash Krishnan', 'url' => 'https://abhilashkrishnan.com', 'logo' => array( '@type' => 'ImageObject', 'url' => 'https://abhilashkrishnan.com/assets/abhilash-krishnan-logo.svg', ), ), 'isPartOf' => array( '@type' => 'Blog', 'name' => 'Thoughts', 'url' => 'https://abhilashkrishnan.com/thoughts/', ), ); if ( ! empty( $cats ) ) { $schema['articleSection'] = $cats; } if ( ! empty( $tags ) ) { $schema['keywords'] = $tags; } echo "\n\n"; echo '\n"; } // ── 2. FAQPage Schema (posts with FAQ sections) ────────────── // Auto-detects two patterns: // a) SEOBot posts with data-faq-q attributes on H3s // b) Any H2 containing "FAQ" followed by H3 + paragraph pairs add_action( 'wp_head', 'ak_inject_faqpage_schema', 6 ); function ak_inject_faqpage_schema() { if ( ! is_single() ) return; global $post; $content = $post->post_content; $faqs = array(); // Strategy 1: data-faq-q pattern (SEOBot posts) if ( preg_match_all( '/]*data-faq-q[^>]*>(.*?)<\/h3>\s*((?:

.*?<\/p>\s*)+)/si', $content, $matches, PREG_SET_ORDER ) ) { foreach ( $matches as $m ) { $question = wp_strip_all_tags( $m[1] ); $answer = wp_strip_all_tags( $m[2] ); $answer = trim( preg_replace( '/\s+/', ' ', $answer ) ); if ( $question && $answer ) { $faqs[] = array( '@type' => 'Question', 'name' => $question, 'acceptedAnswer' => array( '@type' => 'Answer', 'text' => $answer, ), ); } } } // Strategy 2: H2 "FAQs"/"FAQ" followed by H3 + paragraph pairs if ( empty( $faqs ) && preg_match( '/]*>[^<]*FAQ[^<]*<\/h2>\s*((?:\s*(?:

.*?<\/p>\s*)+)+)/si', $content, $faq_block ) ) { if ( preg_match_all( '/]*>(.*?)<\/h3>\s*((?:

.*?<\/p>\s*)+)/si', $faq_block[1], $matches, PREG_SET_ORDER ) ) { foreach ( $matches as $m ) { $question = wp_strip_all_tags( $m[1] ); $answer = wp_strip_all_tags( $m[2] ); $answer = trim( preg_replace( '/\s+/', ' ', $answer ) ); if ( $question && $answer ) { $faqs[] = array( '@type' => 'Question', 'name' => $question, 'acceptedAnswer' => array( '@type' => 'Answer', 'text' => $answer, ), ); } } } } if ( empty( $faqs ) ) return; $schema = array( '@context' => 'https://schema.org', '@type' => 'FAQPage', 'mainEntity' => $faqs, ); echo "\n\n"; echo '\n"; } // ── 3. BreadcrumbList Schema ────────────────────────────────── // DISABLED: AIOSEO Free auto-generates BreadcrumbList schema and // has no toggle to turn it off. Letting AIOSEO handle this avoids // duplicate breadcrumb entries in Rich Results Test. // ── 4. Fix og:image — use featured image per post ──────────── // AIOSEO Free doesn't let you change the default image source, // so it falls back to your profile photo on every post. This // filter overrides og:image with the post's featured image. add_filter( 'aioseo_opengraph_tags', 'ak_fix_og_image', 20 ); function ak_fix_og_image( $tags ) { if ( ! is_single() ) return $tags; global $post; $thumb = get_the_post_thumbnail_url( $post, 'full' ); if ( $thumb ) { $tags['og:image'] = $thumb; $tags['og:image:secure_url'] = $thumb; // Get image dimensions $thumb_id = get_post_thumbnail_id( $post ); if ( $thumb_id ) { $meta = wp_get_attachment_metadata( $thumb_id ); if ( $meta && isset( $meta['width'] ) ) { $tags['og:image:width'] = $meta['width']; $tags['og:image:height'] = $meta['height']; } } } return $tags; } // Also fix Twitter card image add_filter( 'aioseo_twitter_tags', 'ak_fix_twitter_image', 20 ); function ak_fix_twitter_image( $tags ) { if ( ! is_single() ) return $tags; global $post; $thumb = get_the_post_thumbnail_url( $post, 'full' ); if ( $thumb ) { $tags['twitter:image'] = $thumb; } return $tags; } Abhilash Krishnan https://validator.w3.org/feed/docs/rss2.html About Abhilash Krishnan – HOME The Nano Banana Revolution: Google’s Secret Weapon for Mobile Advertising Generative AI in Video Ads: Key Use Cases The Mirror Never Lies: How Virtual Try-On Is Turning Scale Into Sales AdTech vs. Martech: Data Integration Explained AI in Psychographic Profiling for Multi-Device Users AI and Behavioral Data in Creative Strategy Thoughts Cross-Device Segmentation vs. Single-Device Targeting Google Ads rolls out Asset Studio beta globally, enhancing ad creation throughput Search Results How Real-Time Ads Boost App Engagement Why Digital Asset Management Matters for Creative & Marketing Teams? AI Typography Trends in Mobile Advertising 2025 Top Gamification Trends in Mobile Ads 2025 Appium for Cross-Platform Mobile Testing Interactive 3D Ads: Trends in Mobile Advertising Checklist for Reducing Bias in AI Ad Targeting Q&A: AI Video Quality for Mobile Ads How to Improve CTR in Playable Ads How Playable Ads Improve Mobile App Campaigns Subscription Pricing Trends for Mobile Apps in 2025 Creating Functional Ad Creatives, Infographics, UI Design, Image Re-styling, Comics, Website Layouts and more using GPT 4o AI-Powered Insights for Mobile AdTech Context-Aware vs. Behavioral Segmentation: Key Differences The Mobile Funnel Exposed: Where Brand Ads Build Desire, Performance Ads Drive Downloads How Netflix, YouTube & Amazon Are Using AI to Reinvent Mobile and CTV Advertising AI-Powered Audience Segmentation for Programmatic Ads How AI Personalizes Mobile Ads in Real Time When Music Creation Became Magic: DiffRhythm Changes Everything Meta’s Endgame: Fully Automated Ads, Real-Time Optimization, and the New CBO Session Duration vs Frequency: Key Ad Metrics Search Is Everywhere: How SEvO Is Disrupting Digital Advertising as We Know It Design Meets Code: 5 Ways AI is Blurring the Line Between Designers and Developers LLMs officially pass the Turing test, how does that impact advertising? Why Node-Based AI Tools Like FloraFauna.ai Are the Future of Creative Teams Top 7 Case Studies of Minecraft in Digital Education Why Maya Might Be the Most Human-Like AI Voice Assistant Ever Created (And What That Means) 5 Tools and Techniques to Master Vibe Coding for Creative Tech Projects The MCP Revolution, a deep dive into its origin and value proposition. Why Figma Config 2025 Just Made Every Designer’s Wildest Dreams a Reality Ultimate Guide to App Monetization on iOS and Android Lights, Camera, AI: Higgsfield’s One-Click Tool for Viral-Worthy Video Masterpieces Best Practices for Using AI in Video Ad Creation How Rewarded Ads Drive App Revenue Growth Voice Personalization vs. Traditional Audio Ads How to Use AI for Real-Time Ad Personalization in E-Commerce The Spotify of Creation? How Suno, Udio and Riffusion Are Reshaping Music’s Ecosystem AI-Powered Analytics for Attention Metrics