From 01ef135bf9ce696f0c4c427a45fac8a0c10ae2bf Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Mon, 20 Apr 2026 13:02:31 +0700 Subject: [PATCH] Fix typography CSS: wrong selector + overly restrictive meta gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CSS targeted .post-content but the theme template uses .entry-content. Also removed the _prautoblogger_generated meta check — display settings should apply site-wide to all posts, not just PRAutoBlogger-generated ones. Bump 0.7.0 → 0.7.1. Co-Authored-By: Claude Opus 4.6 --- CHANGELOG.md | 9 +++++ .../frontend/class-article-typography.php | 38 +++++++------------ prautoblogger.php | 4 +- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 206cd6c..2b45a89 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to PRAutoBlogger will be documented in this file. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project uses [Semantic Versioning](https://semver.org/). +## [0.7.1] — 2026-04-20 + +### Fixed +- **Typography CSS not applying.** Two bugs: CSS targeted `.post-content` + but the theme template uses `.entry-content`, and the + `_prautoblogger_generated` meta gate excluded posts that predate the + meta flag. Display settings now apply to all single post pages and + target the correct `.entry-content` selector. + ## [0.7.0] — 2026-04-20 ### Added diff --git a/includes/frontend/class-article-typography.php b/includes/frontend/class-article-typography.php index b01fd20..a12282e 100644 --- a/includes/frontend/class-article-typography.php +++ b/includes/frontend/class-article-typography.php @@ -4,9 +4,9 @@ declare(strict_types=1); /** * Injects frontend typography and table styles for PRAutoBlogger-generated posts. * - * What: Outputs inline CSS on single post pages that have the - * _prautoblogger_generated meta flag, applying user-configured - * font family, font size, and table border styles. + * What: Outputs inline CSS on all single post pages, applying + * user-configured font family, font size, and table border + * styles from the Display admin settings. * Who calls it: PRAutoBlogger::register_frontend_hooks() hooks this * into wp_head. * Dependencies: Reads wp_options for typography settings. @@ -27,10 +27,10 @@ class PRAutoBlogger_Article_Typography { private const OPT_TABLE_BORDERS = 'prautoblogger_table_borders'; /** - * Output inline CSS in for PRAutoBlogger posts. + * Output inline CSS in for single post pages. * - * Only outputs on singular post pages generated by PRAutoBlogger. - * The CSS targets .post-content (PR Theme's article body class) + * Applies to all posts — typography settings are site-wide. + * The CSS targets .entry-content (PR Theme's article body class) * and overrides the theme's CSS custom properties so the cascade * works naturally with headings and sub-elements. * @@ -43,11 +43,6 @@ class PRAutoBlogger_Article_Typography { return; } - $post_id = get_queried_object_id(); - if ( '1' !== get_post_meta( $post_id, '_prautoblogger_generated', true ) ) { - return; - } - $css = $this->build_css(); if ( '' === $css ) { return; @@ -73,7 +68,7 @@ class PRAutoBlogger_Article_Typography { $font_family = $this->get_font_family_stack(); if ( '' !== $font_family ) { $rules[] = sprintf( - ".post-content,\n.post-content p,\n.post-content li {\n\tfont-family: %s;\n}", + ".entry-content,\n.entry-content p,\n.entry-content li {\n\tfont-family: %s;\n}", $font_family ); } @@ -81,7 +76,7 @@ class PRAutoBlogger_Article_Typography { $font_size = absint( get_option( self::OPT_FONT_SIZE, 0 ) ); if ( $font_size > 0 ) { $rules[] = sprintf( - ".post-content,\n.post-content p,\n.post-content li {\n\tfont-size: %dpx;\n\tline-height: 1.7;\n}", + ".entry-content,\n.entry-content p,\n.entry-content li {\n\tfont-size: %dpx;\n\tline-height: 1.7;\n}", $font_size ); } @@ -89,22 +84,22 @@ class PRAutoBlogger_Article_Typography { $table_borders = get_option( self::OPT_TABLE_BORDERS, '1' ); if ( '1' === $table_borders ) { $rules[] = implode( "\n", [ - '.post-content table {', + '.entry-content table {', "\tborder-collapse: collapse;", "\twidth: 100%;", "\tmargin: 1.5em 0;", '}', - '.post-content th,', - '.post-content td {', + '.entry-content th,', + '.entry-content td {', "\tborder: 1px solid #d1d5db;", "\tpadding: 0.6em 1em;", "\ttext-align: left;", '}', - '.post-content thead th {', + '.entry-content thead th {', "\tbackground: #f3f4f6;", "\tfont-weight: 600;", '}', - '.post-content tbody tr:nth-child(even) {', + '.entry-content tbody tr:nth-child(even) {', "\tbackground: #f9fafb;", '}', ] ); @@ -158,7 +153,7 @@ class PRAutoBlogger_Article_Typography { /** * Enqueue Google Fonts stylesheet when a web font is selected. * - * Only loads on singular PRAutoBlogger posts that use a Google-hosted font. + * Only loads on singular post pages that use a Google-hosted font. * * Side effects: enqueues a remote stylesheet. * @@ -169,11 +164,6 @@ class PRAutoBlogger_Article_Typography { return; } - $post_id = get_queried_object_id(); - if ( '1' !== get_post_meta( $post_id, '_prautoblogger_generated', true ) ) { - return; - } - $font = sanitize_text_field( get_option( self::OPT_FONT_FAMILY, 'default' ) ); // Map font keys to Google Fonts URLs. Inter is already loaded by the theme. diff --git a/prautoblogger.php b/prautoblogger.php index d13a9c0..bc92139 100644 --- a/prautoblogger.php +++ b/prautoblogger.php @@ -8,7 +8,7 @@ declare(strict_types=1); * Plugin Name: PRAutoBlogger * Plugin URI: https://peptiderepo.com/prautoblogger * Description: Monitors social media for trending topics, generates SEO-friendly blog posts using AI, and publishes them on a daily schedule with full cost tracking and self-improvement metrics. - * Version: 0.7.0 + * Version: 0.7.1 * Requires at least: 6.0 * Requires PHP: 7.4 * Author: PeptideRepo @@ -35,7 +35,7 @@ if ( ! defined( 'ABSPATH' ) ) { | and limits without magic strings. */ -define( 'PRAUTOBLOGGER_VERSION', '0.7.0' ); +define( 'PRAUTOBLOGGER_VERSION', '0.7.1' ); define( 'PRAUTOBLOGGER_DB_VERSION', '1.1.0' ); define( 'PRAUTOBLOGGER_PLUGIN_FILE', __FILE__ ); define( 'PRAUTOBLOGGER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );