Skip to content

Add author archive template and post author box (4.11.0) - #115

Merged
jasperf merged 3 commits into
mainfrom
feature/author-archive-and-box
Oct 15, 2026
Merged

jasperf merged 3 commits into
mainfrom
feature/author-archive-and-box

Conversation

@jasperf

@jasperf jasperf commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Author archives had no template of their own, and single posts showed the author as plain text with no link and no bio, so the profile fields were never displayed.

  • templates/author.html with the new elayne/template-author-archive pattern: avatar, name and profile biography above the post grid. An empty biography renders no empty paragraph.
  • elayne/author Block Bindings source (inc/author-bindings.php) exposes the archive author's name, biography and avatar URL to core heading, paragraph and image blocks. Patterns are evaluated before the main query is resolved, so get_queried_object() is empty in a pattern file (first attempt, a PHP-in-pattern header, rendered an empty name). Bindings resolve at render time.
  • elayne/post-author-box pattern: round avatar, author name linked to the archive, biography, "Written by" label. Added above the tags in all four single-post layouts.
  • The single-post byline author name now links to the author archive.
  • Version bumped to 4.11.0 (style.css, readme.txt, package.json, package-lock.json, CHANGELOG.md).

Why

Found on aseonomics.com, where six authors had empty profiles and posts did not link to their author pages. A site-level database template override covers it there today. This moves it into the theme so every Elayne site gets it.

Tested

On the local demo site (demo.imagewize.test, theme synced from this branch):

  • /?author=1 renders the avatar and name from the binding. With a biography set the paragraph renders; with an empty one it is removed.
  • A single post shows "Written by", the linked author name and avatar.
  • php -l clean on all new files. phpcs reports only the missing @package tag that existing patterns also report.

Not run: Sentinel runtime validation of the new patterns (editor block validation, in particular the bound image block), and a check at mobile width.

Notes

  • Sites that override single or author in the Site Editor keep their own version, so the new box and byline link only appear where the theme templates are in use.

@jasperf
jasperf merged commit c508e0e into main Oct 15, 2026
3 checks passed
@jasperf
jasperf deleted the feature/author-archive-and-box branch October 15, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant