“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 August 15th
- 2015
- I’m Not Quite Sure What Meemoo is… but it’s cool This is episode number 864 where in looking for one thing on the internet I end up falling into something else. In writing up a future UdG Agora Daily Try I was looking for a metaphor image to represent the idea of “random” and found this image: Way down in the caption of the photo […]
- 2014
- I Found a Notebook in a Drawer creative commons licensed ( BY-SA ) flickr photo shared by cogdogblog What was I looking for in the drawer in my office? An envelope? For some reason, I lost track of the task at hand, and noticed the black moleskin notebook with the SFMOMA logo. I remember it. And lost myself down a memory hole […]
- 2012
- MOOC Ramming Speed I’ve been thinking about the pace of MOOCs, and then got bent on a track to make the animated GIF from one of my all time epic movies. The later thought was that this actually applies to any course, and of course a course (Wilbur, where are my oats?) has to have a schedule. But… […]
- 2011
- DIY is Fixing Your Blog cc licensed ( BY NC ND ) flickr photo shared by PetitPlat – Stephanie Kilgast (in dolly mood) Anyone who does stuff knows you do stuff by doing it. Eh? Last night while I was visiting Alec Couros he asked me why there was no image in the right side of the header of my […]
- 2008
- Movie Review: Shallow Plot, Flat Character, Lack of Direction cc licensed flickr photo Day 200/365 “Yawn” by Wellstone This may be in the “pot calling kettle black” category> tag, but I have this long standing growl in my belly about Screencasts. The technology is great, lots of tools, free ones, but when we talk about them it seems to be always about the tools. […]
- 2007
- Fishing for Web 2.0 Gems, Not Laundry Lists I think I have a new mode of developing my workshops and presentations, which of course, does not involve crafting it way ahead of time– but rather than doing my planning, and taking my best shot at it, I am now just tossing out some half baked ideas, picking up feedback/suggestions, and asking people to […]
- 2005
- Play Flickr Tag With Me flickr foto Cool Dogavailable on my flickr Possible new logo? To answer Cadu’s request, I’m starting a new tag game– find photos of signs featuring dogs, and tag them with dogsign (and might as well tag them dog as well to beef up the canine tag rankings). What could make a better logo than a […]
- Cadu On Alert About FlickrTagFight! flickr foto Cadu On Alertavailable on my flickr What? Did I hear that cats beat us dogs in the FlickrTagFight? I cannot believe it! Something must be done! More dog tags! More dog tags! More DOG tags! “This cat tag thing is out of control! I say upload your dog photos en masse and show […]
- FlickrTagFightClub The first rule of FlickrTagFightClub is we do not talk about FlickrTagFightClub… nah, talk about it. Blog about it. See FlickrTagFight, a site that lets you compare two tags, side by side, head to head, in a knock down, winner take all tag fight– see how “Man vs Machine”: And it’s not even close! Machines […]
- 2004
- Web-Unwieldly And Bowl Driving Ear (I am reaching for an all-time obscure title for this entry). Out of curiosity, I followed a link from a TrackBack notification to this entry on Rino’s Blog (in dutch): Weblogs voor studenten OK, we zijn het er na de posts van Alan Levine , Scott Leslie, Sybilla, Pierre, en ondergetekende en de bijbehorende kommentaren […]
- Is Someone Calling Us? flickr foto Is Someone Calling Us?available on my flickr Cadu and Mickey hear the sound of a bag of potato chips being opened… 3 miles away! It’s hard enough to get people to pay attention to your blog, but when the dogs have wandering attention, what is one to do? That’s okay as Mickey (right) […]
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 August 15th
- 2015
- I’m Not Quite Sure What Meemoo is… but it’s cool This is episode number 864 where in looking for one thing on the internet I end up falling into something else. In writing up a future UdG Agora Daily Try I was looking for a metaphor image to represent the idea of “random” and found this image: Way down in the caption of the photo […] ➡
- 2014
- I Found a Notebook in a Drawer creative commons licensed ( BY-SA ) flickr photo shared by cogdogblog What was I looking for in the drawer in my office? An envelope? For some reason, I lost track of the task at hand, and noticed the black moleskin notebook with the SFMOMA logo. I remember it. And lost myself down a memory hole […] ➡
- 2012
- MOOC Ramming Speed I’ve been thinking about the pace of MOOCs, and then got bent on a track to make the animated GIF from one of my all time epic movies. The later thought was that this actually applies to any course, and of course a course (Wilbur, where are my oats?) has to have a schedule. But… […] ➡
- 2011
- DIY is Fixing Your Blog cc licensed ( BY NC ND ) flickr photo shared by PetitPlat – Stephanie Kilgast (in dolly mood) Anyone who does stuff knows you do stuff by doing it. Eh? Last night while I was visiting Alec Couros he asked me why there was no image in the right side of the header of my […] ➡
- 2008
- Movie Review: Shallow Plot, Flat Character, Lack of Direction cc licensed flickr photo Day 200/365 “Yawn” by Wellstone This may be in the “pot calling kettle black” category> tag, but I have this long standing growl in my belly about Screencasts. The technology is great, lots of tools, free ones, but when we talk about them it seems to be always about the tools. […] ➡
- 2007
- Fishing for Web 2.0 Gems, Not Laundry Lists I think I have a new mode of developing my workshops and presentations, which of course, does not involve crafting it way ahead of time– but rather than doing my planning, and taking my best shot at it, I am now just tossing out some half baked ideas, picking up feedback/suggestions, and asking people to […] ➡
- 2005
- Play Flickr Tag With Me flickr foto Cool Dogavailable on my flickr Possible new logo? To answer Cadu’s request, I’m starting a new tag game– find photos of signs featuring dogs, and tag them with dogsign (and might as well tag them dog as well to beef up the canine tag rankings). What could make a better logo than a […] ➡
- Cadu On Alert About FlickrTagFight! flickr foto Cadu On Alertavailable on my flickr What? Did I hear that cats beat us dogs in the FlickrTagFight? I cannot believe it! Something must be done! More dog tags! More dog tags! More DOG tags! “This cat tag thing is out of control! I say upload your dog photos en masse and show […] ➡
- FlickrTagFightClub The first rule of FlickrTagFightClub is we do not talk about FlickrTagFightClub… nah, talk about it. Blog about it. See FlickrTagFight, a site that lets you compare two tags, side by side, head to head, in a knock down, winner take all tag fight– see how “Man vs Machine”: And it’s not even close! Machines […] ➡
- 2004
- Web-Unwieldly And Bowl Driving Ear (I am reaching for an all-time obscure title for this entry). Out of curiosity, I followed a link from a TrackBack notification to this entry on Rino’s Blog (in dutch): Weblogs voor studenten OK, we zijn het er na de posts van Alan Levine , Scott Leslie, Sybilla, Pierre, en ondergetekende en de bijbehorende kommentaren […] ➡
- Is Someone Calling Us? flickr foto Is Someone Calling Us?available on my flickr Cadu and Mickey hear the sound of a bag of potato chips being opened… 3 miles away! It’s hard enough to get people to pay attention to your blog, but when the dogs have wandering attention, what is one to do? That’s okay as Mickey (right) […] ➡
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