Daily Archives: February 19, 2025

Adding ActivityPub Reactions to WordPress themes

You’d think that I would be the last person to do PHP in 2025, but you’d be wrong! Sure, I’ve ignored it for 10 years, but ever since I came back to WordPress couple of years ago, I’ve been a huge PHP fan. I mean, deploying it is easy (compared to the nightmare that’s NodeJS and NPM) and maintaining it is as simple as doing pkg update in a FreeBSD Jail. WordPress and PHP have indeed come a long way.

However, couple of weeks ago I noticed an interesting change in Automattic authored themes (I’m still a huge fan of Twenty Twelve). A good change, that is. It started showing ActivityPub reactions under my posts! Oh god, this is so amazing!

Turns out they integrated this feature with every theme they maintain. So, when I was publishing my photos today on my photo blog (Photos by Antranig) I noticed that someone did like a picture over the Fediverse but the likes were not displayed.

My photo blog uses the Marianne theme. It’s a very minimalist and highly customizable theme. With a bit of digging here and there, I realized that all I need to do is to install and activate the ActivityPub plugin (which is the first thing I always do) and I need to integrate a bit of code where I want to see these reactions.

I used the Theme File Editor in WordPress’ admin panel and I added the following bit of code

<?php echo do_blocks('<!-- wp:activitypub/reactions /-->'); ?>

After that, I started seeing the reactions on my blog!

Gotta say, I love how blogging is becoming (again) central to the web. Text is easy to process (unlike videos) and protocols like HTTP, RSS and AP will be around, hopefully, for the next 100 years.

That’s all folks…

Reply via email.