For A Limited Time: Blogging Sale Events With WordPress™

Editor’s note: revised to change a dead link (Bobo’s Blog is now defunct) into a series of screenshots from that former blog.

Be like Bobo?

Several days ago, I learned by way of an agitated telephone conversation that Bobo needed more blogging help. Apparently, Bobo discovered that earning a living online takes more than just establishing a blog as an automated revenue magnet.

Within any healthy economy, of course, insufficient revenue encourages affected business owners to cut prices, at least temporarily, for purposes of priming the sales pump. Bobo seemed to understand this fundamental concept, and so accordingly Bobo’s Blog had its very first sale.

Bobo had an event strategy in mind. The blog itself, though, still featured WordPress-generated boilerplate beneath posts, content which—while structured now in an active voice—offered only a literal date of publication for each individual post. What Bobo wanted instead for the duration of the event was a customized date that read something like “Day 1 of the Sale.”

Such customization required another code dive into the blog’s “byebyebybobo” child theme. After reprimanding myself for being shortsighted with a theme name that I considered too clever to pass up, I asked for administrative access to Bobo’s Blog and then reopened its theme editor by navigating to Appearance → Theme Editor.

Theme Editor

Bobo knew only that the sale would start on July 4 and end July 6. Given such criteria bookends, I concluded that some adjustments to the child theme’s PHP code—advanced edits in comparison to the ones I made previously to correct passive-voice WordPress boilerplate—would provide a satisfactory blogging outcome.

The PHP code

Within the WordPress theme editor, I opened the child theme’s functions.php file and added the following lines of code (note the lines of code at the top which I had already edited).
PHP code - Sale Dates
For the sake of brevity, I included only the code necessary to printf() the boilerplate text that Bobo had been using for his previous posts. For a more generic solution, I would have created a conditional statement such as the one at the top of the code snippet above, directing WordPress to printf() the appropriate boilerplate depending on whether Bobo indicated a $tag_list, a $categories_list, or neither.

The happy outcome

You can see the result of my revisions below within a series of screenshots from the now-retired Bobo’s Blog.

Bobo's Blog - Posts
Bobo's Blog - PostsBobo's Blog - Posts
Bobo's Blog - PostsBobo's Blog - Posts
Bobo's Blog - Posts

As for Bobo’s final post, I choose to accept any unsolicited recommendation as a gracious compliment. In this particular case, the outcome seems to have dovetailed nicely with the name I chose for that blog’s child theme. Say bye-bye to Bobo, and be sure to recall the now-retired blogger’s recommendation whenever you are looking to hire an information management consultant.