“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 11 posts previously published on September 12th
- 2024
- Wither the Camera/Photograph as Machines of Truth/Reality After so many years of taking/making photography, from an undergraduate photography class at the University of Delaware, to a darkroom in my grad school apartment, to first digital photos with an Apple Quicktake, on through DSLRs, and the alluring capability of an iPhone 13, I’ve been firm on representing the world I see. Even if […]
- 2020
- Declared for LiDA 103 Here we go with a blog post about blogging (maybe the most popular topic ever) as part of participating in the OERu open course Open education, copyright and open licensing in a digital world (LiDA 103). As an introduction, I have my calling card site at another domain, maybe the best internet address I could […]
- An Unplanned Open Course in DIN Cables Taught by Twitter Twitter is nearly universally accepted as a dumpster fire of hate, misinformation, and just badness. And this is just said by people in Twitter. But it can excel in small ways perhaps lost in the noise. If you ask for with something specific, people you do not know like to offer answers. This is not […]
- 2016
- Flying Over Life with the Windows Open I don’t need in-flight entertainment on a digital screen. On a flight from Phoenix to Seattle today (and on to Vancouver), seated in 30F, the window shade is up. My head is pressed against the window like a kid on his first flight ever. Other passengers are looking at device screens, books, sleeping, and nearly […]
- 2013
- I’m Chuffed at Mariana’s Bravery It’s a new word for me (go ahead and giggle you Brits), but I have just finished listening to one of those things that happen fairly regularly in ds106, but can slip by you in the fast flow of all the activity. Mariana Funes aka The ds106 Shrink has been a force of awesomeness since […]
- ds106 vs Zombies Since this week in headless ds106 is an exploration of what digital storytelling means, and what happens when it is digital– it might by interesting to participate in the third iteration of a story that plays out in realtime on the web. mainly through twitter– Twitter vs Zombies, happening September 13-15: Welcome to the third […]
- 2010
- Learning By Doing cc licensed flickr photo shared by Leo Reynolds In preparation for the startup of the PLENK2010 open course that starts tomorrow… well shoot, if my patterns are consistent, what am I talking about being prepared? I’ll start week one with good intentions and let it drop off the edge of the table. But don’t let […]
- 2007
- Twitter Haz Cheezburger I hear a strangle garbling noise as twitter eats yet another tweet. the does not follow you. Send FOLLOW THE to request. Oh, yes, that makes sense now. Share this barking on social media
- 2006
- Build My Presentation (Please?) I’m doing a keynote session for the Basic/Advanced Training track for the K12 Online Conference in October — themed “Unleashing the Potential” (Darren had great words of flattery, plus its a great gang to team up with). The ideas are still brewing, but I was keen to rather than talk generally about the nuts and […]
- Purgatory is Concourse D in Atlanta Airport Sorry Atlanta, you are a fine city, but I can hardly refrain from recommending to anyone to avoid airplane connections at your airport. My 1:45 flight from Baltimore here landed an hour late, and despite Delta’s announcements that “connecting flights had been notified”, they did not relay this to my Austin connection, which left without […]
- 2005
- Apple Skin, Cores, and the Keys to the Orchard Let me begin this story by saying, the despite a recent experience, I love my Apple computers, past, present, and hopefully future. My work flows in Apple colors, where I do all my development, and use other systems to deal with how the other pitiful 95% of the web sees my content. I know less […]
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 11 posts previously published on September 12th
- 2024
- Wither the Camera/Photograph as Machines of Truth/Reality After so many years of taking/making photography, from an undergraduate photography class at the University of Delaware, to a darkroom in my grad school apartment, to first digital photos with an Apple Quicktake, on through DSLRs, and the alluring capability of an iPhone 13, I’ve been firm on representing the world I see. Even if […] ➡
- 2020
- Declared for LiDA 103 Here we go with a blog post about blogging (maybe the most popular topic ever) as part of participating in the OERu open course Open education, copyright and open licensing in a digital world (LiDA 103). As an introduction, I have my calling card site at another domain, maybe the best internet address I could […] ➡
- An Unplanned Open Course in DIN Cables Taught by Twitter Twitter is nearly universally accepted as a dumpster fire of hate, misinformation, and just badness. And this is just said by people in Twitter. But it can excel in small ways perhaps lost in the noise. If you ask for with something specific, people you do not know like to offer answers. This is not […] ➡
- 2016
- Flying Over Life with the Windows Open I don’t need in-flight entertainment on a digital screen. On a flight from Phoenix to Seattle today (and on to Vancouver), seated in 30F, the window shade is up. My head is pressed against the window like a kid on his first flight ever. Other passengers are looking at device screens, books, sleeping, and nearly […] ➡
- 2013
- I’m Chuffed at Mariana’s Bravery It’s a new word for me (go ahead and giggle you Brits), but I have just finished listening to one of those things that happen fairly regularly in ds106, but can slip by you in the fast flow of all the activity. Mariana Funes aka The ds106 Shrink has been a force of awesomeness since […] ➡
- ds106 vs Zombies Since this week in headless ds106 is an exploration of what digital storytelling means, and what happens when it is digital– it might by interesting to participate in the third iteration of a story that plays out in realtime on the web. mainly through twitter– Twitter vs Zombies, happening September 13-15: Welcome to the third […] ➡
- 2010
- Learning By Doing cc licensed flickr photo shared by Leo Reynolds In preparation for the startup of the PLENK2010 open course that starts tomorrow… well shoot, if my patterns are consistent, what am I talking about being prepared? I’ll start week one with good intentions and let it drop off the edge of the table. But don’t let […] ➡
- 2007
- Twitter Haz Cheezburger I hear a strangle garbling noise as twitter eats yet another tweet. the does not follow you. Send FOLLOW THE to request. Oh, yes, that makes sense now. Share this barking on social media ➡
- 2006
- Build My Presentation (Please?) I’m doing a keynote session for the Basic/Advanced Training track for the K12 Online Conference in October — themed “Unleashing the Potential” (Darren had great words of flattery, plus its a great gang to team up with). The ideas are still brewing, but I was keen to rather than talk generally about the nuts and […] ➡
- Purgatory is Concourse D in Atlanta Airport Sorry Atlanta, you are a fine city, but I can hardly refrain from recommending to anyone to avoid airplane connections at your airport. My 1:45 flight from Baltimore here landed an hour late, and despite Delta’s announcements that “connecting flights had been notified”, they did not relay this to my Austin connection, which left without […] ➡
- 2005
- Apple Skin, Cores, and the Keys to the Orchard Let me begin this story by saying, the despite a recent experience, I love my Apple computers, past, present, and hopefully future. My work flows in Apple colors, where I do all my development, and use other systems to deal with how the other pitiful 95% of the web sees my content. I know less […] ➡
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