“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 July 9th
- 2024
- Isadore/Ira & Abraham/Alan “like a distant radio station” Podcasting, it’s still a thing, eh? Everyone is doing them, posting them in their substa– no not everyone. But to play my old man internet card, I was rambling Podcasting Schmodcasting back when the people who would spin out the bird site were deep into making Odeo. I was recording with that bubble gum pack […]
- 2020
- The Soldier at Tree 106 “Brief is his immortal story” Nine years ago, an almost random brushing of one person’s story, even if immortal, so brief as to leave almost no remnant, ripples back again. Just because I left a little shred of information here in the blog pile. That someone far away could find. At once time this would be turned into a video […]
- 2013
- ds106 Daily Create Challenge (9): Back When I Was 90… Today’s ds106 Daily Create was a video challenge– I expect the weak to fall away. Videos are not all that big deal, and properly planned, they can be a one take shoot and upload, easily done from a smart phone. For today we had to forecast ourselves into the future looking back: It is your […]
- ds106 Daily Create Challenge (8): Yes it’s all Eights cc licensed ( BY SA ) flickr photo shared by Alan Levine Today’s ds106 Daily Create was a drawing one Today is the Eighth of July. Make an artistic drawing using only figure eights I’m to blame for this one- wanted to avoid an American bias for July 4 so why not make the eighth […]
- Guess What Kind of Yahoos Are Making the Design Decisions for Flickr? cc licensed ( BY ) flickr photo shared by Chris Lott It’s gotta be monkeys (no offense to the primates) (but I love it when my creative common search turns up an image from a friend, hi Chris). Seriously– who is Yahoo using as a test group for the “new” flickr? The latest WTF is […]
- 2011
- Okay, Let’s Make this StoryBox Thing Easy cc licensed ( BY NC ) flickr photo shared by D’Arcy Norman My last tactical effort to solicit items for the StoryBox had a good number of reads and tweets– and I got nothing sent in. And in talking to some friends, I figured (once again, lather, rinse, repeat), I am doing it wrong. Asking […]
- 2009
- Free in Free Audiobook Format So the new book from Chris Anderson (a.k.a Dr Long Tail) entitled Free: The Future of a Radical Price is out in a number of FREE formats- FREE Sricbd eBook and FREE audio file downloads, plus Google Books, and maybe the comic book version is next. Or manga. Or the Numa Numa dance version. All […]
- 2008
- The Web in 2008 State of the Web 2008 by cogdogblog posted 9 Jul ’08, 11.32pm MDT PST on flickr What a great presentation of web trends, with extra snark! 0at.org/summer-2008.html "This was created on a cloudy afternoon in Seattle by Matthew Inman of 0at.org" linktribution to the Shifted Librarian fun fun fun Share this barking on social media
- Meeting Leigh Meeting Leigh by cogdogblog posted 9 Jul ’08, 1.33pm MDT PST on flickr At the welcome dinner for Horizon.au, I finnaly got to meet in person, Leigh Blackall… now I am more eager to find my way back to New Zealand. Share this barking on social media
- Traveling Through The Body Ringer dirty wet rag by norwichforlife posted 11 Apr ’07, 8.26pm MDT PST on flickr norwich state Dispatch for Melbourne Australia, Monday July 7- Just arriving here in Australia has been both exciting and exhausting. I’ve done the long leg flights several times now (LA to Sydney and the marathon, LA to Melbourne) and am glad […]
- 2004
- North of the Border……. (eh?) It’s been more than a while since our return from visiting 2 weeks in Canada, so before all the brain cells rot, here is an attempt to summarize a glorious trip. I managed to snap more than 600 photos (tossed about half), and still they really do not capture the experience. It is a generalized […]
- 2003
- The Fuss wiki is Open Okay folks. We have polished off most of the rough edges of the wiki part of our presentation on What’s the Fuss abour RSS? and are here tossing it out for your viewing. Update (Sept 3, 2003) The wiki has been spiffed up and moved to http://careo.elearning.ubc.ca/cgi-bin/wiki.pl?TheFuss Share this barking on social media
- a teaser for “Fuss about RSS” This is just a pre-notice teaser for our upcoming LOVCOP teleconference on July 11, 2003: What’s the Fuss about RSS?. Tune in at 9 am Pacific, 10 am Mountain, 11 am Central, noon Eastern. For access details (it is a toll free call), rush and click over to the LOVCOP site and sign up or […]
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 July 9th
- 2024
- Isadore/Ira & Abraham/Alan “like a distant radio station” Podcasting, it’s still a thing, eh? Everyone is doing them, posting them in their substa– no not everyone. But to play my old man internet card, I was rambling Podcasting Schmodcasting back when the people who would spin out the bird site were deep into making Odeo. I was recording with that bubble gum pack […] ➡
- 2020
- The Soldier at Tree 106 “Brief is his immortal story” Nine years ago, an almost random brushing of one person’s story, even if immortal, so brief as to leave almost no remnant, ripples back again. Just because I left a little shred of information here in the blog pile. That someone far away could find. At once time this would be turned into a video […] ➡
- 2013
- ds106 Daily Create Challenge (9): Back When I Was 90… Today’s ds106 Daily Create was a video challenge– I expect the weak to fall away. Videos are not all that big deal, and properly planned, they can be a one take shoot and upload, easily done from a smart phone. For today we had to forecast ourselves into the future looking back: It is your […] ➡
- ds106 Daily Create Challenge (8): Yes it’s all Eights cc licensed ( BY SA ) flickr photo shared by Alan Levine Today’s ds106 Daily Create was a drawing one Today is the Eighth of July. Make an artistic drawing using only figure eights I’m to blame for this one- wanted to avoid an American bias for July 4 so why not make the eighth […] ➡
- Guess What Kind of Yahoos Are Making the Design Decisions for Flickr? cc licensed ( BY ) flickr photo shared by Chris Lott It’s gotta be monkeys (no offense to the primates) (but I love it when my creative common search turns up an image from a friend, hi Chris). Seriously– who is Yahoo using as a test group for the “new” flickr? The latest WTF is […] ➡
- 2011
- Okay, Let’s Make this StoryBox Thing Easy cc licensed ( BY NC ) flickr photo shared by D’Arcy Norman My last tactical effort to solicit items for the StoryBox had a good number of reads and tweets– and I got nothing sent in. And in talking to some friends, I figured (once again, lather, rinse, repeat), I am doing it wrong. Asking […] ➡
- 2009
- Free in Free Audiobook Format So the new book from Chris Anderson (a.k.a Dr Long Tail) entitled Free: The Future of a Radical Price is out in a number of FREE formats- FREE Sricbd eBook and FREE audio file downloads, plus Google Books, and maybe the comic book version is next. Or manga. Or the Numa Numa dance version. All […] ➡
- 2008
- The Web in 2008 State of the Web 2008 by cogdogblog posted 9 Jul ’08, 11.32pm MDT PST on flickr What a great presentation of web trends, with extra snark! 0at.org/summer-2008.html "This was created on a cloudy afternoon in Seattle by Matthew Inman of 0at.org" linktribution to the Shifted Librarian fun fun fun Share this barking on social media ➡
- Meeting Leigh Meeting Leigh by cogdogblog posted 9 Jul ’08, 1.33pm MDT PST on flickr At the welcome dinner for Horizon.au, I finnaly got to meet in person, Leigh Blackall… now I am more eager to find my way back to New Zealand. Share this barking on social media ➡
- Traveling Through The Body Ringer dirty wet rag by norwichforlife posted 11 Apr ’07, 8.26pm MDT PST on flickr norwich state Dispatch for Melbourne Australia, Monday July 7- Just arriving here in Australia has been both exciting and exhausting. I’ve done the long leg flights several times now (LA to Sydney and the marathon, LA to Melbourne) and am glad […] ➡
- 2004
- North of the Border……. (eh?) It’s been more than a while since our return from visiting 2 weeks in Canada, so before all the brain cells rot, here is an attempt to summarize a glorious trip. I managed to snap more than 600 photos (tossed about half), and still they really do not capture the experience. It is a generalized […] ➡
- 2003
- The Fuss wiki is Open Okay folks. We have polished off most of the rough edges of the wiki part of our presentation on What’s the Fuss abour RSS? and are here tossing it out for your viewing. Update (Sept 3, 2003) The wiki has been spiffed up and moved to http://careo.elearning.ubc.ca/cgi-bin/wiki.pl?TheFuss Share this barking on social media ➡
- a teaser for “Fuss about RSS” This is just a pre-notice teaser for our upcoming LOVCOP teleconference on July 11, 2003: What’s the Fuss about RSS?. Tune in at 9 am Pacific, 10 am Mountain, 11 am Central, noon Eastern. For access details (it is a toll free call), rush and click over to the LOVCOP site and sign up or […] ➡
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.