/*
Theme Name: OceanWP Child
Theme URI: https://oceanwp.org/
Description: OceanWP Child Theme
Author: Your Name
Author URI: https://yourwebsite.com
Template: oceanwp
Version: 1.0
*/

/* =========================================
   Read Meter Styles - Final
   ========================================= */
.dmb-read-meter {
    font-family: 'Inter', sans-serif !important; /* Forces Inter font */
    font-size: 15px !important;
    font-weight: 700 !important; /* 700 is Bold */
    color: #000000; /* Dark Gray */
    display: inline-block;
    line-height: 1.5;
}
<?php
// --- OG Image Logic ---
// Default fallback (used ONLY when no featured image exists)
$default_og_image = 'https://defendmybusiness.com/wp-content/uploads/2024/03/Untitled-design-10.png';

// Start with default
$og_image = $default_og_image;

// If this page/post HAS a featured image → use it, ignore default
if ( is_singular() && has_post_thumbnail( get_the_ID() ) ) {
    $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );
    if ( ! empty( $thumb[0] ) ) {
        $og_image = esc_url('/wp-content/themes/oceanwp-child/$thumb[0]');
    }
}

// OG meta helpers
$og_title       = is_singular()
    ? get_the_title() . ' | ' . get_bloginfo('name')
    : get_bloginfo('name') . ' | ' . get_bloginfo('description');

$og_url         = esc_url('/wp-content/themes/oceanwp-child/is_singular(') ? get_permalink() : home_url('/wp-content/themes/oceanwp-child/$_SERVER['REQUEST_URI']') );

$og_description = ( is_singular() && has_excerpt() )
    ? wp_strip_all_tags( get_the_excerpt() )
    : get_bloginfo('description');
?>

<!-- Open Graph -->
<meta property="og:type"        content="website" />
<meta property="og:url"         content="<?php echo $og_url; ?>" />
<meta property="og:title"       content="<?php echo esc_attr( $og_title ); ?>" />
<meta property="og:description" content="<?php echo esc_attr( $og_description ); ?>" />
<meta property="og:image"       content="<?php echo esc_url('/wp-content/themes/oceanwp-child/$og_image'); ?>" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:site_name"   content="<?php echo esc_attr( get_bloginfo('name') ); ?>" />

<!-- Twitter Card -->
<meta name="twitter:card"        content="summary_large_image" />
<meta name="twitter:title"       content="<?php echo esc_attr( $og_title ); ?>" />
<meta name="twitter:description" content="<?php echo esc_attr( $og_description ); ?>" />
<meta name="twitter:image"       content="<?php echo esc_url('/wp-content/themes/oceanwp-child/$og_image'); ?>" />

