“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 9 posts previously published on June 25th
- 2018
- The Indispensable Feed Reader Now an @Ontarioextend Curator Module Activity Call me a web old fogey, I don’t care. I cannot blog enough about the value of using an RSS Reader for tracking a set of blogs, web site sources that are important to your work. I just added this as a new Ontario Extend Activity Bank item — This Indispensable Digital Research Tool, We […]
- Inserting Images When You Cannot Upload Them I’m a big proponent of using images with my online writing, all of my blog posts start with an image before I even write. But sometimes you do not have access to upload images, but with a little bit of know how you can sometimes insert them. This happened just today to Danny, a participant […]
- 2015
- Engorged Apps and Nonsensical iOS Math That’s not a photo of a hot dog eating dude; it’s the flickr iPhone app (and it’s friends) stuffing itself for no reason on your file storage space. Of course, it’s not really file storage space, since in iOS you are forever told by your Apple Nanny that there is no file system. The file […]
- 2014
- To Badge [Yourself] or to Be Badged? I intend not to discuss the merits/demons of badging systems. My main response on weighing such questions always slide down to “It Depends”. But to me badging, nanodegreeing, calculating massive course dropouts remains overweighted on one side of the system. This has been mulling in the cranium for a while (often best where ideas are […]
- 2013
- Contributing Less cc licensed ( BY SA ) flickr photo shared by Alan Levine Last week I did a favor for a friend and took a load of trash and broken furniture to the dump. Maybe it’s me, but I find it fascinating to see where our trash ends up. I may be wildly projecting, but I […]
- 2008
- Down Under in Strawberry Captain Westley by cogdogblog posted 30 Oct ’07, 10.50am MDT PST on flickr Westley organized a great way to end my trip with this rowing expedition in the Sydney Harbour I’m headed down to the Phoenix airport to pick up my friend/colleague Westley Field who I got to know last October during the Australia tour. […]
- WordPress Alchemy- Blog in a Blog In the vein of last February’s WordPress Dissection where I detailed the ripping apart and patching together of a WP template, here’s another bit if funny business I recently did in my favorite technology tool. More or less, I have a main WP site, with a nested second complete WP site sitting inside of it, […]
- 2007
- Little Bits of Webness It helps to sit back and take in how prolific the web has become- no it does not reach every world citizen and there are divides, indeed, but to lose sight of how it permeates culture and digs deeper all the time– well it means something to me to acknowledge it. What is ordinary today […]
- Aunty Social As social services spread, mutate, spawn like they are, I am sure I’m in the same boat as at least a few others– what was once novel and every peek drew attention, at what point do you draw the line? Do you automatically reciprocate any offered friendship? I;m pretty much connected with a good circle […]
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 9 posts previously published on June 25th
- 2018
- The Indispensable Feed Reader Now an @Ontarioextend Curator Module Activity Call me a web old fogey, I don’t care. I cannot blog enough about the value of using an RSS Reader for tracking a set of blogs, web site sources that are important to your work. I just added this as a new Ontario Extend Activity Bank item — This Indispensable Digital Research Tool, We […] ➡
- Inserting Images When You Cannot Upload Them I’m a big proponent of using images with my online writing, all of my blog posts start with an image before I even write. But sometimes you do not have access to upload images, but with a little bit of know how you can sometimes insert them. This happened just today to Danny, a participant […] ➡
- 2015
- Engorged Apps and Nonsensical iOS Math That’s not a photo of a hot dog eating dude; it’s the flickr iPhone app (and it’s friends) stuffing itself for no reason on your file storage space. Of course, it’s not really file storage space, since in iOS you are forever told by your Apple Nanny that there is no file system. The file […] ➡
- 2014
- To Badge [Yourself] or to Be Badged? I intend not to discuss the merits/demons of badging systems. My main response on weighing such questions always slide down to “It Depends”. But to me badging, nanodegreeing, calculating massive course dropouts remains overweighted on one side of the system. This has been mulling in the cranium for a while (often best where ideas are […] ➡
- 2013
- Contributing Less cc licensed ( BY SA ) flickr photo shared by Alan Levine Last week I did a favor for a friend and took a load of trash and broken furniture to the dump. Maybe it’s me, but I find it fascinating to see where our trash ends up. I may be wildly projecting, but I […] ➡
- 2008
- Down Under in Strawberry Captain Westley by cogdogblog posted 30 Oct ’07, 10.50am MDT PST on flickr Westley organized a great way to end my trip with this rowing expedition in the Sydney Harbour I’m headed down to the Phoenix airport to pick up my friend/colleague Westley Field who I got to know last October during the Australia tour. […] ➡
- WordPress Alchemy- Blog in a Blog In the vein of last February’s WordPress Dissection where I detailed the ripping apart and patching together of a WP template, here’s another bit if funny business I recently did in my favorite technology tool. More or less, I have a main WP site, with a nested second complete WP site sitting inside of it, […] ➡
- 2007
- Little Bits of Webness It helps to sit back and take in how prolific the web has become- no it does not reach every world citizen and there are divides, indeed, but to lose sight of how it permeates culture and digs deeper all the time– well it means something to me to acknowledge it. What is ordinary today […] ➡
- Aunty Social As social services spread, mutate, spawn like they are, I am sure I’m in the same boat as at least a few others– what was once novel and every peek drew attention, at what point do you draw the line? Do you automatically reciprocate any offered friendship? I;m pretty much connected with a good circle […] ➡
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.