Terence Eden. He has a beard and is smiling.

Terence Eden’s Blog

Theme Switcher:

How to make Markdown Footnotes start at Zero in WordPress

· 5 comments · 200 words


The Logo for WordPress.

As a dedicated and professional computer scientician, I believe that all indices must start at zero. Not one, not two, but zero. The zeroth element is sacrosanct to our creed; for in the beginning there was nothing. If you're using WordPress's JetPack, it uses an ancient version of Markdown Extra. You can either monkeypatch this, or install a separate Markdown plugin. I've patched my fork of…

WordPress - Display hook action priority in the dashboard

· 2 comments · 400 words


List of actions with various priorities.

If your WordPress site has lots of plugins, it's sometimes difficult to keep track of what is manipulating your content. Ever wondered what priority all your various actions and filters have? This is a widget which will show you which actions are registered to your blog's hooks, and their priority order. It looks like this: Stick this code in your theme's functions.php or in its own plugin. …

Liberate your Markdown posts from JetPack in WordPress

· 350 words


JetPack Markdown switched off.

A scrap of code which I hope helps you. Problem You installed the WordPress JetPack plugin and wrote all your blog posts in Markdown. Now you want to remove JetPack or replace it with a better Markdown parser. You turn off JetPack's "Write posts or pages in plain-text Markdown syntax". You click edit on a post and see the HTML version of your page. Where did the Markdown version go? …

Replace Twitter Embeds with Semantic HTML

· 5 comments · 650 words · Viewed ~1,165 times


Tweet from me in 2009. "Ah. I appear to have spent the majority of the night playing World Of Goo What an addictive little game."

I logged into Twitter using a fresh account last week. No followers, no preferences set. The default experience was an unending slurry of racism and porn. I don't care to use Twitter any more. Whatever good that was there is now drowned in a cess-pit of violent filth. I still have a lot of Tweets embedded on this blog. Using WordPress, it was easy to paste in a link and have it converted to an…

Remove unnecessary closing slash on get_the_post_thumbnail() in WordPress

· 5 comments · 250 words


The HTML validator showing lots of info messages.

I am a pedant. I like it when validators say "nothing to report". No errors, no warnings, no information messages. My blog is plagued with messages on the HTML validator saying Info: Trailing slash on void elements has no effect and interacts badly with unquoted attribute values. By default, the WordPress function get_the_post_thumbnail() spits out HTML like: <img width="1024" height="593" …

Named Alternates for WordPress

· 1 comment · 150 words · Viewed ~319 times


Screenshot of Lynx, the text browser, showing named alternates.

HTML documents have the concept of an alternate representation of the document. For example, a page's header might say: <link rel="alternate" type="application/rss+xml" href="https://shkspr.mobi/blog/feed"> That tells you there's an alternative representation of the page, what sort of content it is, and where it is located. That's nice. But it's hard for a browser to tell the user what that…

link rel="alternate" type="text/plain"

· 4 comments · 550 words · Viewed ~1,831 times


The Logo for WordPress.

Hot on the heels of yesterday's post, I've now made all of this blog available in text-only mode. Simply append .txt to the URl of any page and you'll get back the contents in plain UTF-8 text. No formatting, no images (although you can see the alt text), no nothing! Front page https://shkspr.mobi/blog/.txt This blog post https://shkspr.mobi/blog/2024/05/link-relalternate-typetext-plain/.txt A …

A completely plaintext WordPress Theme

· 4 comments · 200 words · Viewed ~959 times


Screenshot showing my blog rendered just as text.

This is a silly idea. But it works. I saw Dan Q wondering about plaintext WordPress themes - so I made one. This is what this blog looks like using it: The Code You only need two files. An index.php and a style.css. The CSS file can be empty, but it needs to exist - otherwise WordPress won't let you activate the theme. The index file displays the requested post, or front page, in plain…

WordPress GeSHi Highlighting for Markdown

· 200 words


The PHP logo.

I've launched a WordPress Plugin for an extremely niche use-case. WP GeSHi Highlight Redux works with WordPress's Classic Editor to convert Markdown to syntax highlighted code. That allows me to write: ```php $a = "Hello"; $b = 5 * 2; echo $a . str($b); ``` And have it displayed as: $a = "Hello"; $b = 5 * 2; echo $a . str($b); I've previously written about the WP GeSHi Highlight plugin.…

Server-Side Rendering of Embedded Markdown Code Snippets in WordPress

· 3 comments · 200 words


The Logo for WordPress.

Because I'm a grumpy old man, I don't use Gutenberg or Block themes on my WordPress. Instead, I write everything in Markdown. When I write code snippets in Markdown, they look like this: ```php $a = 1; echo $a; if ($a < 5) { // Do Something return thing( $a, true ); } ``` But I want to render that with code highlighting. I was using the Prismatic Plugin. It is excellent and very…

3,000 blog posts!

· 9 comments · 850 words · Viewed ~291 times


The Logo for WordPress.

This is the 3,000th blog post I've published on this site! Bloody hell! I first started a blog on Blogger.com in 2004 - twenty years ago. Like all blogs, I managed half a dozen posts before I forgot about it. Cut to 2007 and I decided to launch shkspr.mobi as a weird site dedicated to rendering Shakespeare's plays in txt spk. Judging by Archive.org I was still using Blogger. By 2008 I was…

A personal WordPress MonoRepo for my themes and plugins

· 350 words


The Logo for WordPress.

I use a self-built WordPress theme for this blog. I also use a variety of self-developed WordPress plugins for various enhancements. I used to publish these plugins, but I get terribly confused by the SVN shenanigans involved, and they weren't used by many people, so I stopped. Recently, I've been moving all my plugin code into my theme. This is sort-of-but-not-quite a MonoRepo. I've also…