So, I Switched (Back) To WordPress
Website
So, I Switched (Back) To WordPress

On this page

After around six years dabbling with Ghost and static site builders I’ve migrated back to WordPress.
First impressions of the wp-admin
panel were “meh”. It’s not really changed in the last few years and it’s really not as nice as Ghost’s admin panel. It does the job, though.
The Gutenberg editor, however, is amazing. It’s such a massive improvement—at least from memory—over the old WYSWYG editor.
To get things just so, I’ve had to install a few plugins:
- Yoast SEO
- Advanced Custom Fields
- I’ve created an
external_url
field so that I can use it in the JSON feed 1.
- I’ve created an
- JSON Feed (by Manton Reece and Daniel Jalkut)
- Code Block Pro
- Secure Passkeys
- Various plugins to add Fediverse tags to the
<head>
element - ActivityPub
To get footnotes to render correctly in RSS readers—i.e., appear as pop-ups—I’ve added the below code to functions.php
:
PHP
function clean_gutenberg_footnotes_for_rss($content) {
if (!is_feed()) return $content;
$refIndex = 1;
$uuidToIndex = [];
// Step 1: Replace <sup> references with numbered links and track mapping
$content = preg_replace_callback(
'/<sup data-fn="([^"]+)" class="fn">\s*<a[^>]*>(\d+)<\/a>\s*<\/sup>/i',
function ($matches) use (&$uuidToIndex, &$refIndex) {
$uuid = $matches[1];
if (!isset($uuidToIndex[$uuid])) {
$uuidToIndex[$uuid] = $refIndex++;
}
$n = $uuidToIndex[$uuid];
return "<sup id=\"fnr-{$uuid}\"><a href=\"#fn-{$uuid}\">{$n}</a></sup>";
},
$content
);
// Step 2: Rewrite footnote section and replace ↩ links
$content = preg_replace_callback(
'/<ol class="wp-block-footnotes">(.*?)<\/ol>/is',
function ($matches) use (&$uuidToIndex) {
$footnotes = $matches[1];
preg_match_all('/<li id="([^"]+)">(.*?)<\/li>/is', $footnotes, $liMatches, PREG_SET_ORDER);
$output = '<div class="footnotes"><ol>';
foreach ($liMatches as $li) {
$id = $li[1];
$rawText = $li[2];
$n = $uuidToIndex[$id] ?? '?';
// Replace ↩ <a> link with formatted Unicode arrow link
$fixedText = preg_replace(
'/<a[^>]+href="#' . preg_quote($id, '/') . '-link"[^>]*>.*?<\/a>/is',
'<a href="#fnr-' . $id . '" class="footnoteBackLink" title="Jump back to footnote ' . $n . ' in the text.">↩︎</a>',
$rawText
);
$output .= '<li id="fn-' . esc_attr($id) . '"><p>' . trim($fixedText) . '</p></li>';
}
$output .= '</ol></div>';
return $output;
},
$content
);
return $content;
}
add_filter('the_content', 'clean_gutenberg_footnotes_for_rss');
Finally, credit for this theme goes to Rich Tibor.
- I’ll add it to the RSS xml feed soon. ↩︎
Discussion