Create a "Share To Mastodon" Button for WordPress


A WordPress Popup.

Everyone1 is decamping from Twitter to Mastodon! The great thing about the Federated Internet (hereafter the "Fediverse") is that it is distributed. The bad thing is… it is distributed! What do I mean by that? Here's an example of the problems with decentralised systems. If I want to create a link on a website which…

Continue reading →

Semantic Comments for WordPress


The Logo for WordPress

As regular readers will know, I love adding Semantic things to my blog. The standard WordPress comments HTML isn't very semantic - so I thought I'd change that. Here's some code which you can add to your blog's theme - an an explanation of how it works. The aim is to end up with some…

Continue reading →

Better Footnotes in WordPress JetPack


A very long footnote.

Previously, I've written about using Footnotes in WordPress Markdown. A reader notified me that the footnotes1 weren't very accessible. This blog post describes the problem and proposes a solution. The Problem Using WordPress's JetPack, markdown footnotes are rendered as: Some text <sup id="fnref-1234-1"><a href="#fn-1234-1" class="jetpack-footnote">1</a></sup> ... <li id="fn-1234-1">The footnotes. <a href="#fnref-1234-1">↩</a></li> There are two main problems…

Continue reading →

Footnotes in Markdown


A very long footnote.

Did you know - WordPress Markdown supports footnotes1? There is some documentation but I thought I'd write a slightly more comprehensive guide. The code is pretty simple. Write [^1] where you want your first footnote link to appear. Then, later in the document, write [^1]: The text of the note. It doesn't matter what number…

Continue reading →

WordPress Stories - a quick review


In product screenshot. You've got early access to Story Posts and we'd love for you to give it a try. Now stories are for everyoneCombine photos, videos, and text to create engaging and tappable story posts that your visitors will love.Story posts don't disappearThey're published as a new blog post on your site, so your audience never misses out on a thing.

The WordPress app for Android prompted me to add a story! This is a new and experimental feature. Sadly, it isn't very good. Here's how it works. There's a brief description and some aspirational screenshots. There's a basic image picker. Then you get some basic tools to add text on top of your image. I…

Continue reading →

How to preserve deleted Tweets in WordPress?


HTML code of an iFrame.

I like quoting people's Tweets in my blog posts. But, sometimes, people delete their Tweets. This blog post examines two questions. How to preserve Tweets in blog posts that they are still readable even after the user deletes them. Whether this is morally acceptable behaviour. Let's tackle the easy question first. Preserving Tweets Using the…

Continue reading →

WordPress's undocumented stats API


WordPress console showing a JSON output.

This blog runs on WordPress. Using their JetPack plugin, I get fairly detailed stats on views and visitors. But, bizarrely, the API is undocumented. Well, sort of... Let me explain: Just Show Me The Code Here's the API call to get a year's worth of data about your blog. https://public-api.wordpress.com/rest/v1.1/sites/shkspr.mobi::blog/stats/visits ?unit=day &date=2021-01-03 &quantity=365 &stat_fields=views%2Cvisitors' Replace…

Continue reading →

Adding Semantic Reviews / Rich Snippets to your WordPress Site


Screenshot of JSON code in a web page.

This is a real "scratch my own itch" post. I want to add Schema.org semantic metadata to the book reviews I write on my blog. This will enable "rich snippets" in search engines. There are loads of WordPress plugins which do this. But where's the fun in that?! So here's how I quickly built it…

Continue reading →

Howto: Disable image pop-ups in WordPress comments


An mshots popup obscuring the screen.

If you have the Akismet spam plugin for WordPress, you'll be familiar with this problem. When your mouse pointer goes over any URL, you get a large website preview taking over parts of your screen. I asked for a way to turn this off and I'm happy to say the developers listened! Sadly, there's no…

Continue reading →

Improving WordPress Video Accessibility


A video with an easy to see play button.

In order to provide a video playback UI, WordPress uses the excellent MediaElement library. Recently, I discovered a slightly annoying flaw - I couldn't see the play button! Here's a screenshot of the video UI. In the middle of this screenshot is a white play button. I have trouble seeing it, because the video's background…

Continue reading →