If you’ve been reading this blog for any length of time, you’ve noticed my penchant for asides — brief digressions in which I explain a term, offer advice, or explain why I’m doing something a certain way.
Until yesterday, I was doing that via raw HTML, by adding a div tag and assigning it to the CSS class “aside,” which is defined in my theme’s style.css file:
<div class="aside">This content will appear as an aside.</div>
And that makes the text above look like this:
Well, I’m just as lazy as the next guy, and just as careless, too. So sometimes I was forgetting to close that div, or was misspelling it, or otherwise making a general mess by typing a simple div tag.
Which got me to thinking: Why not make a WordPress shortcode plugin, to abbreviate and simplify this repetitive task?
Making your own shortcode is an excellent way to learn the basics of writing WordPress plugins. And once you get the hang of it, you’ll find WordPress plugin authoring isn’t all that hard to do, yet will make you infinitely more marketable as a Web developer.