I Resisted the Urge to Nuke My Theme…
...I just cloned it into a child theme and tweaked like crazy instead.

On a semi-regular basis, I develop an itch to throw away whatever theme I happen to be using and pick something else.

Truth be told, there is something cathartic about the process of reworking your blog’s look from time to time; digging into all the available settings and finding things that give that ‘fresh coat of paint’ feel.

This time around, it was the font that did it.

Picking a New Font

I wanted to keep the legibility of my previous setting (Open Sans, 20px, 400 weight) without it being so… Overbearing. Weight 400 is titled as ‘Regular’, but with that particular font, it looked semi-bold in all cases.

I asked ChatGPT to help in making this change. I asked it to check what I had on the blog at the moment, told it what I liked and didn’t like, and asked it to give some recommendations for both font and settings.

It did a pretty good job! The font I’m using now is one of the suggested ones, Inter Tight, still at 20px (I played around with 18px before returning, though), and shifted to weight 300.

And thus- I was happy. The itch to change theme averted.

Ahhh.

Bliss.

I Was This Close to Leaving It Alone

But there were other things I could maybe (finally) get around to fixing.

For example:

Dark Mode: My Previous ‘Auto Dark Mode’ plugin stopped getting updates. But a recent chat had reminded me I could probably stand to fix that.

So I did. No theme change needed, even.

Testing out ‘WP Dark Mode’ now, and so far, I quite like it. I notice there is a bug in Zen browser (Firefox fork) where flipping from dark to light, and back to dark again, doesn’t update all text back to a dark-mode appropriate colour. You have to reload the page to get it back.

Oddly, doesn’t seem to happen in Chrome.

Calendar Widget: One of the minor annoyances of this theme I’ve just lived with since I put it in place was that the Calendar Widget didn’t have any styling applied to ensure that days with a post were visibly different from the days without.

ChatGPT rode in to the rescue again, and further impressed me when I asked it if it could give me a colour picker for each instance of colour in the code — and it did.

Ultimately, though, another easy fix — and no driver for either nuking the current plan… or for getting a little crazier and making a child theme of it.

Jumping the Tracks and Making a Child

Child theme.

It was a concept I was already familiar with — but had just never been pressed quite far enough to do anything with that knowledge.

If you’re unfamiliar; Child Themes are the manner in which you customise the code and extend the capability of a theme without the risk that all of your customisations and extensions get blown away whenever the parent theme next gets an update.

Secondary Titles was my use case here. But I didn’t start out wanting to make a child theme.

Not by a long shot. That came later.

There is a plugin I’ve had (for quite some time now), that enables Secondary Titles in WordPress. It can even automatically inject the code you need so that they show up in posts, pages, or whatever other content types you want them.

The problem with the auto-code injection approach is that it modifies the code for the title function directly. So anything that tries to getTitle will be returned the full primary + secondary title together. Including:

  • ‘Recent Posts’ sidebar widget, and
  • WordPress Reader

That latter one was particularly troublesome because WP Reader will take whatever formatting suggestions you may have included in the CSS of your own site and throw them out.

Heck, it will even throw out line break requests.

So what you end up with is the Primary Title running immediately (not even a space!) into the secondary title, with both having equal font weighting.

Dangit. You win this round, WPReader.

Blocksy — my current theme (well… I guess technically my ‘current theme’ is Blocksy-child now) — makes it a slightly non-trivial matter to alter the header code.

There was a time, a couple of themes ago, where I would just put in the getSecondaryTitle() function call into the appropriate place with every theme update and call it a day.

But this time around, it required an update to the functions.php file and some filtering logic on when to, and not to, make that secondary call.

I almost just put this particular project to bed.

It has been a few years at least since I used secondary titles, maybe it was just time to uninstall the addon and let them go?

NOPE!

Especially because ChatGPT through my querying on approach, and having it help me navigate Blocksy’s slightly weird (to me, I think it’s just modern) file and function structure, had been making references quite pointedly to the fact that I should just fricken listen to it and do a child theme — and more than that, it could even give me a zip of the starter code required for it.

Grudgingly, I accepted, poked into the code and then uploaded it, expecting a need to roll back comically quickly.

But… By George… It worked.

There were still a few more tweaks to the filtering required, and I had to import Blocksy’s more general appearance config over into the child theme (but this was straightforward at least).

I ended up at the end of all this burrowing back into the myriad of Appearance Customisation and Design menus anyway, but hey, I had my fun, scratched that itch, learnt that ChatGPT knows more about the WordPress code base (and even specifics for some Themes) than I ever would have guessed, and that child theme setups aren’t that scary after all.

As a bonus, I think I like the result, too!

Naithin
Naithin

Gamer, reader, writer, husband and father of two boys. Former WoW and Gaming blogger, making a return to the fold to share my love of all things looty.