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. function edent_priority_dashboard_widget_contents() { global $wp_filter; // Change this to …
Continue reading →
I am a bear of very little brains sometimes. I had a site which, for various boring reasons, was printing a <style> element in the middle of the HTML's body. Because <style> is a metadata element, it should only appear within the <head> element. This is OK: <!doctype html> <html> <head> <style> a { color: #f00; } </style> </head> <body> … This is an error: <!doctype html> <html> <head> </head> <body> <style> a { color: #f00; } </style> … Most mo…
Continue reading →
I'm a little bit obsessed with the idea of Semantic markup. I want the words that I write to be understood my humans and machines. Imagine this piece of code: print( "Hello, world!" ) Is that code example written in Python? C++? Basic? Go? Perhaps you're familiar enough with every programming language to tell - but most people aren't. Wouldn't it be nice to give an indication of what programming language is used in an example? Here's how we might represent it in HTML: <pre> <code> …
Continue reading →
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? Background When you write using JetPack's Markdown plugin, the Markdown version is stored in…
Continue reading →
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 embed. But I don't want to direct people to a dangerous site. So here's a somewhat automated way to …
Continue reading →
Sitting down, eh? What's that all about? You bend your knees and just hope something is there to catch you as you fall! So, the good folks at Flexispot have sent me their latest chair to review. Just like most modern office chairs, it is fully adjustable. But, rather than having a a set of big foam cushions, the seat, back, and head-rest are 100% mesh. It's currently on sale for £290. The Build As with any bit of modern furniture, your LEGO skills will come in handy. In truth, it's a …
Continue reading →
Unless someone invents time travel, this is probably the closest you'll get to experiencing Janis Joplin live on stage. Jukebox musicals have a variety of viable routes to success. You either do a Mama Mia / We Will Rock You and just spin a weak story around the tunes - or you do a straight biography interspersing songs with whatever anecdotes the surviving members can agree on. Janis treads a different path. It is presented as a gig, with Janis singing and telling stories. The "twist" is…
Continue reading →
Turns out, you can just relive your childhood for £2.99 on eBay! I was exactly the right age when this book came out, and I was the perfect target audience. A boy in a sleepy suburb finds a mysterious device which allows him to understand every language. Could it be… Aliens?!?!?! It's all biking to the woods, arguing with siblings, navigating growing up, and living in a diverse community. Oh, and aliens, obviously. The book is slim - 130 small pages - and easy to finish in an hour. Although …
Continue reading →
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 embed. But I don't want to direct people to a dangerous site. So here's a somewhat automated way to …
Continue reading →
Dan Q very kindly shared his script to make WordPress do good HTML. But I couldn't get it working. Looking at the HTML it was spitting out, the meta generator said it was HTML Tidy version 5.6.0. That's quite old! I confirmed this by running: echo tidy_get_release(); Which spat out 2017/11/25. Aha! There are a few bugs in this version of HTML Tidy, some of which are fixed in later versions. Here's how to fix them. Auto Indent doesn't work. This is fixed by manually specifying "indent"…
Continue reading →
It's sometimes useful to run experiments yourself, isn't it? New investors are often told that, when investing for the long term rather than chasing individual stocks, it is better to be invested for the longest possible time rather than trying to do "dollar cost averaging". DCA is the process of spreading out over time the purchasing of your investments. That way, you don't lose it all if the market drops the day after you invest. Let me explain... Imagine that it is 1994 and your rich…
Continue reading →
For lots of online accounts, a date of birth is nothing more than a very weak second factor. The majority of places aren't checking your identity, cross-referencing your birthdate, and personalising your experience based on your Zodiac sign. At most, they'll wish you a happy birthday and / or let you recover your account by providing your date of birth. But, of course, lots of people know your birthday. Everyone you went to school with, family members, colleagues. It might even be on your…
Continue reading →