Restyle WordPress themes for editorial YouTube ops look

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
eric
2026-08-25 05:01:08 -05:00
parent 4d9ee50d07
commit 5a339a4658
4 changed files with 466 additions and 63 deletions

View File

@@ -20,7 +20,7 @@ add_action('wp_head', static function (): void {
echo '<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client='
. esc_attr($client) . '" crossorigin="anonymous"></script>' . "\n";
echo '<meta name="author" content="Nomadro Editorial">' . "\n";
echo '<meta name="theme-color" content="#ffffff">' . "\n";
echo '<meta name="theme-color" content="#f6f3ee">' . "\n";
// Deploy replaces REPLACE_UMAMI_WEBSITE_ID with a UUID; only emit when set.
if (preg_match('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i', NOMADRO_UMAMI_WEBSITE_ID)) {
echo '<script defer src="https://umami.nomadro.com/script.js" data-website-id="'
@@ -69,55 +69,31 @@ add_action('init', static function (): void {
}
});
/** Editorial CSS: readable articles, image presentation, footer trust links. */
add_action('wp_enqueue_scripts', static function (): void {
$css = <<<'CSS'
:root { --nomadro-accent:#6d28d9; }
body { -webkit-font-smoothing: antialiased; }
.nomadro-hero-figure img,
.wp-block-post-featured-image img,
.wp-post-image {
border-radius: 14px;
width: 100%;
height: auto;
}
.nomadro-hero-figure figcaption,
figure.wp-block-image figcaption {
color: #667085;
font-size: 0.92rem;
margin-top: 0.5rem;
}
.nomadro-callout {
border-left: 4px solid var(--nomadro-accent) !important;
background: #f5f3ff !important;
border-radius: 8px;
padding: 14px 18px !important;
margin: 1.5rem 0 !important;
}
.entry-content, .wp-block-post-content {
font-size: 1.0625rem;
line-height: 1.75;
}
.entry-content h2, .wp-block-post-content h2 {
margin-top: 2rem;
line-height: 1.3;
}
.wp-block-post-excerpt, .entry-summary {
color: #475467;
}
.nomadro-trust-footer {
display: flex;
flex-wrap: wrap;
gap: 0.75rem 1.25rem;
justify-content: center;
padding: 1.5rem 1rem 2rem;
font-size: 0.95rem;
}
.nomadro-trust-footer a { color: #344054; text-decoration: underline; }
CSS;
wp_register_style('nomadro-adsense-opt', false, [], '1.0.0');
wp_enqueue_style('nomadro-adsense-opt');
wp_add_inline_style('nomadro-adsense-opt', $css);
wp_enqueue_style(
'nomadro-theme',
content_url('mu-plugins/nomadro-theme.css'),
[],
'2.1.0'
);
}, 30);
add_action('wp_body_open', static function (): void {
if (!is_front_page() && !is_home()) {
return;
}
echo '<section class="nomadro-hero" id="nomadro-hero"><div class="nomadro-hero-inner">';
echo '<div class="nomadro-kicker">YouTube operations</div>';
echo '<h1>Run a YouTube channel like an operator.</h1>';
echo '<p>Practical guides on production pipelines, analytics, monetization, and team workflows—written for creators who treat YouTube as a business.</p>';
echo '</div></section>';
});
add_action('wp_footer', static function (): void {
if (!is_front_page() && !is_home()) {
return;
}
echo '<script>document.addEventListener("DOMContentLoaded",function(){var h=document.getElementById("nomadro-hero");var b=document.querySelector(".wp-site-blocks");if(h&&b&&b.firstElementChild){b.insertBefore(h,b.firstElementChild.nextSibling);}});</script>';
}, 20);
/** Persistent trust links in footer (AdSense reviewers look for these). */