fix(theme): blog posts no longer fade out; readable post layout

- Scroll reveal used threshold 0.15: a section taller than ~6.7 screens (a
  long article) never reached it, so after the reveal class hid it, it
  stayed hidden. Reveal as soon as any part enters (threshold 0).
- Post header: full-width title with meta below and a normal gap
- Article: heading sizes per level, photos keep their shape (no crop),
  icon-sized inline SVGs, full-width embeds
- Strip the imported 'Home' breadcrumb line from posts and card excerpts
- Theme 1.0.15

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 21:20:34 +03:30
parent d89f8c2a0b
commit 023b998694
6 changed files with 43 additions and 7 deletions

View File

@@ -194,6 +194,21 @@ function hoho_blog_query( array $state ) {
);
}
/**
* Imported posts start with a stray "Home" breadcrumb line (left over from the
* old page builder). Drop it from the article and from card excerpts.
*/
function hoho_strip_leading_home( $text ) {
return preg_replace( '#^\s*(?:<p>\s*Home\s*</p>|Home\b\s*)#i', '', (string) $text );
}
add_filter(
'the_content',
function ( $content ) {
return ( is_singular( 'post' ) && in_the_loop() ) ? hoho_strip_leading_home( $content ) : $content;
},
20
);
/**
* Card date chip, as in the design: relative for the last week, then a date.
*/
@@ -240,7 +255,7 @@ function hoho_article_card( $post, $wrap = 'li' ) {
</a>
</div>
</div>
<p class="acard__excerpt"><?php echo esc_html( wp_trim_words( get_the_excerpt( $post ), 24, '&hellip;' ) ); ?></p>
<p class="acard__excerpt"><?php echo esc_html( wp_trim_words( hoho_strip_leading_home( get_the_excerpt( $post ) ), 24, '&hellip;' ) ); ?></p>
<?php
$inner = ob_get_clean();
if ( 'related' === $wrap ) {