I spent an afternoon today tinkering with the blog, giving the homepage a fresh look.

There weren’t many changes — just three things: removing that huge welcome banner, adding a sidebar, and fixing the categories. But each one was more trouble than I expected.

Writing it down for the record — maybe it’ll be useful to you.


1. That Big Banner on Your Homepage — Does Anyone Actually Look at It?

What did my blog homepage look like before?

At the top was a dark-background banner that said “Linux Enthusiast,” with a few category links below it and a downward-scrolling arrow.

This thing is technically called a Hero.

Sounds cool, right? But it took up 640 pixels of height.

In other words, every time I opened my own blog, the first thing I saw wasn’t an article — it was a dark wall. I had to scroll down a full screen to see any content.

I always felt something was off, but I never changed it.

Until today.

I removed it.

It wasn’t some high-level operation — I just skipped the code that generated this banner on the blog homepage. I kept the original structural position, but emptied the content and removed the background — leaving only a transparent spacer of a few dozen pixels.

This way, the navigation bar and article list don’t stick together, but that dark banner that took up most of the screen — gone.

The world is at peace.


2. Article List: From “A Few Lines on a Whiteboard” to “Individual Cards”

The original article list looked like this: white background, gray dividing lines, row after row.

Not exactly ugly, but it always felt like it lacked “breathing room” — just a thin line between each entry. After a few glances, it got tiresome.

I added a light gray background, 8px border radius, and 12px spacing to each entry.

The effect was instantly different. Each entry looked like a small card, neatly arranged. When you mouse over them, the background darkens slightly with a subtle shadow — a little “tactile feedback” for the reader.

There was a small pitfall worth mentioning here.

My theme uses Bootstrap’s grid system, with each article card wrapped in a <div class="col-12">. I wanted to use CSS’s nth-child(odd/even) to alternate background colors between odd and even entries — but everything matched odd, and not a single even appeared.

It took me a moment to realize: each <article> was its parent container’s only child element. From the parent container’s perspective, every child element was nth-child(1) — of course they’re all odd.

I eventually fixed it by counting odd/even from the parent container level (though I ended up deciding that a uniform color looked better and didn’t use it).

These are the kinds of problems you’d never think of from reading documentation — you have to step on them yourself.


3. Sidebar: WordPress Gave Me an Empty Room

The theme actually came with a sidebar system, with a corresponding widget area called sidebar-6.

But it had always been empty.

WordPress’s is_active_sidebar() returned false, so the entire sidebar simply wasn’t rendered — not even an empty shell.

I registered three widgets: Category Directory, Article Archive, and Recent Articles.

After adding them, the sidebar appeared, but only two categories showed up.

I have 9 categories!

I checked the database and found that the count field in the wp_term_taxonomy table was all wrong. The OS Kernel category actually had 79 articles, but the database showed 0.

The reason was simple: these articles had been batch-imported through a script earlier, and the import process didn’t update the category’s count cache. WordPress thought they were empty, so the widget didn’t display them.

I ran a SQL query to fix the counts.

But the story wasn’t over.

The categories displayed correctly in the sidebar, but clicking on them — went to the homepage.

Looking at the URL: /category/os%e5%86%85%e6%a0%b8/

I see. The category slugs were URL-encoded Chinese characters, and WordPress’s URL router didn’t recognize them.

I changed the Chinese category slugs to English: os-kernel, memory-basics, semiconductor

Clicked on one — worked fine.

Don’t forget to flush the rewrite rules after changing slugs, or you’ll get 404s.


4. Two More Things I Fixed While I Was At It

Made the blog the homepage.

Previously, the homepage was a separate “desktop pet” introduction page, with the blog at the /blog/ subpath. Since nobody was looking at that intro page, I figured I’d put the article list on the homepage instead. One less click for visitors.

Opened comments on all articles.

I checked the database — out of 161 articles, only 5 had comments enabled.

The remaining 156 all had comment_status = closed.

Another casualty of the batch import script.

I opened them all. I know tech blogs probably won’t get many comments anyway (laughs), but having them closed doesn’t feel right.


A Final Word

None of the changes I made today were “functional” — no new plugins, no new features, no earth-shattering architecture upgrades.

But these are exactly the things that determine how you feel when you open your own blog every day.

I didn’t care much about these things before. “As long as it works,” I thought.

But after making these changes today, I refreshed the homepage and saw those neat cards, the clearly organized categories in the sidebar, and the archives sorted by year and month —

I can’t quite describe it, but it just feels a lot better.

I guess this is what they call “polishing.”

Last modified: 2026年7月3日

Author

Comments

Write a Reply or Comment

Your email address will not be published.