Adding a CSS File to WordPress

Of all things in the world that are frustrating, Googling for how to do things in WordPress is the absolute worst.

I guess I’m not used to, like, search for stuff that’s popular. Because whatever you search for related to WordPress, the top ten answers are from content farms that wants to sell you something, and in addition to being sleazy, their answers are all wrong.

So you have to resort to The Dark Web (i.e., page two of the Google search results) before you get to something that seems to half-way make sense… and then it doesn’t. Not really.

OK, here’s my issue: I wanted to edit the CSS of a WordPress site with Emacs. Because editing the CSS in a text box in a browser is miserable, horrible and no good. If you Google this, you’ll find out that there’s a bunch of plugins that… allows you to edit the CSS in a text box in a browser.

I just want a file somewhere! That I can edit!

So, on the Dark Web, I found somebody with a solution: Just put the extra code in the theme! Or put the code in functions.php! But won’t those changes be overwritten when WordPress is upgraded? Sure!

*sigh*

So after going to The Even Darker Web (page three), and putting four different answers together, I now have a sustainable solution: CSS in a file, loaded in a way that won’t be overwritten when you upgrade WordPress.

Here’s how. Create the directory /var/www/html/wp-content/plugins/site-css. Put the following in the file site-css.php inside that directory:

<?php
/*
Plugin Name: Site CSS
Description: Site specific CSS
*/

function add_custom_css() {
  wp_enqueue_style("site-css", "/wp-content/plugins/site-css/site-css.css");
}

add_action("wp_enqueue_scripts", "add_custom_css");

Go to the WordPress admin panel, and choose “Plugins”. You’ll see a new plugin there called “Site CSS”. Activate it.

That’s it! You can now edit the file called /var/www/html/wp-content/plugins/site-css/site-css.css to your heart’s delight via Tramp in Emacs and tweak those little rounded CSS corners until they look… just… right:

Did you find this blog on page seventeen in Google? You’re welcome!

Emacs Supremacy

I use Emacs to control the stereo, so 95% of the screen is Emacs:

But I like to have a clock there too, so since I started this thing (in… 1997?) I’ve also had an xwatch in the corner. The other night I decided that this was completely and utterly untenable:

So I thought “it must be easy to make an SVG based clock, surely” and looked forward to some hacking, but unfortunately Ulf Jasper wrote an SVG clock back in 2011, and it’s on ELPA, so I just used that instead. (I tweaked it slightly to get the look I wanted.)

Look! Emacs rules supreme over the screen!

To get the look I wanted, I had to delve into portions of Emacs I’ve never seen before, but to remove the borders/continuation markers between the two buffers at the bottom (one showing the songs and the other the clock), I had to:

(set-face-foreground 'vertical-border "black")
(set-display-table-slot standard-display-table 0 ?\ ))

There you go.

Useful Consumer Review

My wifi saga has been long and painful. Using a single AP, no matter how monstrous, just hasn’t worked in this flat: I’d get miserable bandwidth whenever not within two meters of the AP, and some parts of the flat got no coverage at all no matter where I put it. I guess wifi doesn’t like brick walls?

So I tried mesh setups, and that helped: I got coverage in the entire flat, but bandwidth was miserable. I mean, like 5Mbps and stuff. The last iteration was with Ubiquiti Amplifi, and I could probably have lived with the miserable bandwidth, but a bigger problem was that is was unstable: It required rebooting from time to time to force the units talk to each other again.

But! Earlier this year I finally put in some VLAN switches so that I could watch Netflix. (It totally makes sense.) So now I could install a real multi-AP wifi network where the nodes communicate with each other over cables, like god intended.

So for a few months now I’ve had Ubiquiti Unifi, and I’m pretty pleased with it. I’ve got three nodes, which gives me complete coverage, and I get like 125Mbps from the couch I’m sitting now.

Setting things up was a breeze once you get past all the strange neologies Ubiquiti uses, calling the controller a “Cloud Key Gen2” and “2.4GHz” for “2G” and calling the APs “devices” and etc etc etc.

And they try to upsell you on switches. All the gadgets are powered over ethernet, which is really handy, but any PoE switch will do.

But it’s been completely stable: Haven’t had to reboot the network even once, which is a first for me with wifi.

Of course, Ubiquiti are asshats, but eh whatevs. I assume that everything on the wifi is unsafe anyway, so I don’t care that much. What I do care about is this:

The APs are extremely sticky. If my laptop is connected to one AP, it’ll stay connected to it, even if it drops to 1 bar and 2.4GHz, and I have to either reconnect on the laptop or in the app. (It’s pretty easy in the app — there’s a “reconnect” menu item that’s quick and speedy.)

One problem with the app, though, is that it usually crashes when you open it.

Details! It’s not like anybody expects a hardware maker to be able to write functioning software.

So I give this thing all the thumbs up, because this is probably as good as it’s going to get, because: Wifi sucks, and it always will.

NFLX2019 November 8th: Let It Snow

Let It Snow. Luke Snellin. 2019. ☆☆☆☆★★

My prejudices immediately told me that this was going to be a horrible teen comedy thing. But it’s not! It’s a fun teen comedy thing.

The actors are charming (it’s an ensemble thing) and the interlocking plots (FSVO plot) are all kinda interesting (and intersects in interesting ways) and there’s a handful of lines that made me laugh out loud. And there’s nothing annoying here: Not even the soundtrack.

It’s just like a total delight. I mean, it’s not the best movie ever or anything, but it’s just fun.

Oh, I should get the furniture in from the balconies…

Anyway, I’m just 30 minutes in, and I do so hope that there’s not going to be a third act with All The Drama. But I’m not holding my breath.

[time passes]

OK, I took the furniture in while er watching the movie.

Wow! The weeds that totally took over the planter are still green! That stuff is indomitable.

[more time passes]

Yeah, like clockwork, The Dreaded Third Act rolls in, bringing all the drama that we didn’t miss from the first two parts. Why do filmmakers do this?

I subtract two stars for the final thirty minutes.

This post is part of the NFLX2019 blog series.

NFLX2019 November 1st: Holiday in the Wild

Holiday in the Wild. Ernie Barbarash. 2019. ☆☆★★★★

This is initially just confusing, because they’re sending off somebody to college…

… but which one is he? Is the one in the middle or the one on the right? Who’s playing the teenager here?

(It’s the one in the middle, and he’s cast for this way-appropriate-age role because he’s Rob Lowe’s son.)

Oh yeah, Rob Lowe is in this, in addition to Kristin Davis (from Sex and the City), because this is one of those Netflix movies that’s a “let’s have two famous actors in a comedy and see whether that just like works” thing.

And he plays a guy in Africa who’s a game warden, a pilot and a painter. Yes, you guessed it: Romance ensues.

The movie is almost crass in the way it piles it on.

The shots from southern Africa are really pretty. They could be from a really posh ad campaign for safaris.

It’s just so limp. Davis and Lowe are fine, but there’s no repartee; there’s no zing. I get that it’s supposed to be sweet holiday fluff, but it’s less than fluff. There’s just nothing there.

And like clockwork… when there’s one third left, the “third act” starts, and with that a bunch of contrived drama.

I predict that this will not become a sentimental holiday evergreen.

This post is part of the NFLX2019 blog series.