“Who ya gonna call?” “CODEBUSTERS”
No.
But the metaphor of Ghostbusters crossing the streams was inversely appropriate to a little bit of code action over the holidays (of which the actual action was nil).
But this was fun.
This nice tweet from John Johnston (who spawned the idea) reminded me of a WordPress plugin I had made
The WP Posted Today plugin is meant to offer a short code you can put on a site and it will list all previous posts on the current calendar day (this of course is useful if you actually still blog regularly) (cough) (cough).
Just for grins I checked the page where I use my own plugin. Yikes. Red Alert. It displayed all the ones for December 29 in years past, but the part where it should list how many there were was blank.
I dug into my own code… and found myself a bit lost. Crossed. I was not even sure where I got the sprintf functions (John’s original code?) that were aimed to be compatible if anyone every wanted a language translation (maybe, or it’s just that thing when people code things differently).
Taking the path of least resistance, I took out the code where I think the problem was occurring and did it a more simple, but brute force way.
And it worked.
So I updated the version on GitHub and felt at peace with the world. In the off chance someone stumbled into my little corner of code, they would find something that works (or should work).
And then (here comes a stream crossing) Michael Hanscom @djwudi — someone I don’t think I’ve ever communicated with — tweets that he had seen pretty much the same bug and offered a fix.
In looking at his post I saw the fix he made, and said– that’s better than mine! So I decided today to roll back my changes in place of Michael’s solution (but also keeping a modification I had made to remove extraneous calls when not needed for singular versus multiple results).
I noted the extra change he made in hos own version
Plus, I’ve made one other tweak to the plugin, so that it adds a link to the end of the excerpt to better handle “microblog” style entries that don’t have titles, so I still get to feel good about that part, as well. 🙂 My coding skills may be underdeveloped and rusty from lack of regular use, but they’re not entirely atrophied!
In this case, these microblog type entries (see Michael’s demo page) lack titles, so yes, a link is needed at the end of the post excerpt.
Yet I could see that regular posts (like on my site) did not need the extra link, and also, not everyone might want the arrow Michael likes.
I solved this cleverly by creating an additional shortcode parameter more which defaults to a blank string. In the shortcode function, we convert any attributes passed to variables with
extract(shortcode_atts( array( "month" => '', "day" => '', 'excerpt' => 1, 'more' => '' ), $atts ));
So on my site, where I just used the shortcode There are 13 posts previously published on August 30th
- 2018
- WordPress CSV Export Plugin Now With Date Bookends My motivation for adding features to stuff I code is increased by all the following: praise, a coin in the top jar, and when it also fits my own needs. I’ve got a little WordPress plugin (my first ever and one of my favorite found feature images) I wrote a while ago to export data […]
- Constellations. Metaphors. SPLOT? It’s in the Stars. I’ve been working on a prototype web site I was asked to do for Tannis Morgan at JIBC. Beyond getting into some new code tricks, the best part of this was how she first approached me on it. With a metaphor. Meet a “Constellection” – my portmanteau for a collection of web resources arranged like […]
- 2017
- Where Have All The Bloggers Gone? One of the last of the Bloghicans hit his 3003 blog mark today. While out walking today, as it often does, that was swirling around in my head when I also, for some reason, cross associated with Pete Seeger (don’t ask for logic). But I heard an ed-tech cover song fermenting, and when that happens, […]
- Cog.Dog: Calling Card at My Dream Domain Share this barking on social media
- 2015
- EDU Angst Plug yer ears. It’s another Alan cover song. And its pretty horrible. This one has been in my mind a while. First, I really really like Cracker’s song Teen Angst, it’s a rocker and a half (and the video even has a dalmatian running around in it) with that lyric What the world needs now, […]
- 2012
- Tricking Out the Barking Dog I’ve written some before about a mod I made to the Graphpaper Press Full Screen Theme for my photo showcase site, Barking Dog Studio. I dig this theme for many reasons, it features large photos on single pages, it has an attractive grid on the front. It feels less bloggy: The mod I made was […]
- 2011
- Dreams, Cookies, and Epic Radio With the hundreds of tweets, emails, and thoughts I feel in the air regarding my Mom’s passing, I am more that “lifted” by my net. As Mom would say, “I am blown away”. I was asked to edit the audio part of her “Stories on ds106 radio” where she talks about butterflies. I’d heard her […]
- 2007
- What’s That Google Calender Doing in My MediaWiki? Like Duvall’s Kilgore, who said “there’s nothing like napalm in the morning”, for a web geek, there’s nothing like a bit of curious fiddling with code to make something work. Today’s feat was finagling a MediaWiki extension to display a Google Calendar in our sites. I’ve been using GCal for a year to manage our […]
- 2006
- Spam Redirection Embedded in Feeds Thanks to Todd for alerting me that a low life spammer was exploiting Feed2JS to redirect feed links to their product site. It was clever, coy, and annoying all in one package. The spammer was generating a feed that had embedded javascript in the channel->description field of the feed, and when rendered via Feed2JS with […]
- 2005
- WordPressed 1.5.2 After running the minor upgrade for WordPress from 1.5.1 to 1.5.2, I can say their process is rather easy. I still smile when you run the upgrade script at it says “Step 1. It may take a while though, so be patient.”, then it completes and says “There’s actually only one step. So if you […]
- Tablet-ing flickr fotoStranger Things Have Happenedavailable on my flickr I am still bleed Apple colors, but I have a new TabletPC for working with some new pen based applications (see what is on the screen. It’s a strange world indeed I’m still trying to get familiar with the TableTC environment with this new HP tc1100… no […]
- 2004
- Short Staffed The CogDog will be doing a lot more running around for the time being. It is not just the zaniness of semester start up, but I am feeling the loss of a valuable part-time student programmer who has been with MCLI for 5 years. This reduces my technology staff from 1.5 to 1.0, and that […]
- DirectorWeb at Ten In another of our self-serving web celebrations, August 2004 marked the 10th year since we created the DirectorWeb, a resource site for users of Macromedia Director. We have an irregular scrapbook of the site showing some its evolution– this was an early lesson on that in the rush to create new content, iin web site […]
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 13 posts previously published on August 30th
- 2018
- WordPress CSV Export Plugin Now With Date Bookends My motivation for adding features to stuff I code is increased by all the following: praise, a coin in the top jar, and when it also fits my own needs. I’ve got a little WordPress plugin (my first ever and one of my favorite found feature images) I wrote a while ago to export data […] ➡
- Constellations. Metaphors. SPLOT? It’s in the Stars. I’ve been working on a prototype web site I was asked to do for Tannis Morgan at JIBC. Beyond getting into some new code tricks, the best part of this was how she first approached me on it. With a metaphor. Meet a “Constellection” – my portmanteau for a collection of web resources arranged like […] ➡
- 2017
- 2015
- EDU Angst Plug yer ears. It’s another Alan cover song. And its pretty horrible. This one has been in my mind a while. First, I really really like Cracker’s song Teen Angst, it’s a rocker and a half (and the video even has a dalmatian running around in it) with that lyric What the world needs now, […] ➡
- 2012
- Tricking Out the Barking Dog I’ve written some before about a mod I made to the Graphpaper Press Full Screen Theme for my photo showcase site, Barking Dog Studio. I dig this theme for many reasons, it features large photos on single pages, it has an attractive grid on the front. It feels less bloggy: The mod I made was […] ➡
- 2011
- Dreams, Cookies, and Epic Radio With the hundreds of tweets, emails, and thoughts I feel in the air regarding my Mom’s passing, I am more that “lifted” by my net. As Mom would say, “I am blown away”. I was asked to edit the audio part of her “Stories on ds106 radio” where she talks about butterflies. I’d heard her […] ➡
- 2007
- What’s That Google Calender Doing in My MediaWiki? Like Duvall’s Kilgore, who said “there’s nothing like napalm in the morning”, for a web geek, there’s nothing like a bit of curious fiddling with code to make something work. Today’s feat was finagling a MediaWiki extension to display a Google Calendar in our sites. I’ve been using GCal for a year to manage our […] ➡
- 2006
- Spam Redirection Embedded in Feeds Thanks to Todd for alerting me that a low life spammer was exploiting Feed2JS to redirect feed links to their product site. It was clever, coy, and annoying all in one package. The spammer was generating a feed that had embedded javascript in the channel->description field of the feed, and when rendered via Feed2JS with […] ➡
- 2005
- WordPressed 1.5.2 After running the minor upgrade for WordPress from 1.5.1 to 1.5.2, I can say their process is rather easy. I still smile when you run the upgrade script at it says “Step 1. It may take a while though, so be patient.”, then it completes and says “There’s actually only one step. So if you […] ➡
- Tablet-ing flickr fotoStranger Things Have Happenedavailable on my flickr I am still bleed Apple colors, but I have a new TabletPC for working with some new pen based applications (see what is on the screen. It’s a strange world indeed I’m still trying to get familiar with the TableTC environment with this new HP tc1100… no […] ➡
- 2004
- Short Staffed The CogDog will be doing a lot more running around for the time being. It is not just the zaniness of semester start up, but I am feeling the loss of a valuable part-time student programmer who has been with MCLI for 5 years. This reduces my technology staff from 1.5 to 1.0, and that […] ➡
- DirectorWeb at Ten In another of our self-serving web celebrations, August 2004 marked the 10th year since we created the DirectorWeb, a resource site for users of Macromedia Director. We have an irregular scrapbook of the site showing some its evolution– this was an early lesson on that in the rush to create new content, iin web site […] ➡
to get the arrow codes he likes. This works because output for each found post looks like
// output post and link
$output .= '
' . get_the_title() . '';
// display excerpt if we want it
if ( $excerpt ) $output .= ' ' . get_the_excerpt();
// for microblog output where there might not be titles so add a link at end
// h/t https://www.michaelhanscom.com/eclecticism/2020/01/02/rss-feed-weirdness-and-php-debugging/
$output .= ' ' . $more . '';
So how is that for the odds of streams crossing on the same obscure bit of code? That’s the old fashioned kind of net serendipity that still happens.
Thanks Michael! Check out his 20 year old blog, he’s an “Enthusiastically Ambiverted Hopepunk” quite the tag line.
Featured Image: Edit of the Ghostbusters Cross Streams scene found in the Ghostbusters Fandom Wiki site which states “Community content is available under CC-BY-SA unless otherwise noted.” I replaced part of the background with a screenshot of the WP Posted Today PHP code.
Share this barking on social media