WordPress summaries on some posts

Internet

WordPress icon.

Every time I try to pry myself away from WordPress which I've been moved over to in 2005 after thinking for far too long, another feature comes along that makes the decision harder. I'll give you the attention you deserve one day Django!

In this case, it's the ability to show a summary of a post with a link to read more, but only posts you elect it to happen to. Given I merged all my blogs into this one recently I've decided to use this on anime reviews which tend to have a ton more graphics and are much longer. It also means I can append a mild NSFW warning on some posts above the read more link when Her Senjougaharaness insists on spending half an episode in the shower.

To pull it off, make sure you have this code within the the_content() method, NOT the_summary() as you may assume. Finally, wherever you want the more link to be inserted, add <!--more-->.

Spiffyness.

Author bio and support

Me!

Ruben Schade is a technical writer and IaaS engineer in Sydney, Australia who refers to himself in the third person in bios. Wait, not BIOS… my brain should be EFI by now.

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or buy some silly merch. Thanks!