“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 December 2nd
- 2023
- Silly Generators Get Better Sharing Buttons Twis (present tense of “twas”?) not a real big demand on the internet for the kind of silly randomness I spat out to make a web toy that generates random utterances about AI using the quotes of Agent 007’s gadget master, Q. And there’s still place and value to do these things without just reachhig […]
- 2022
- Should Alt Text be Visible/Accessible for All? There has been over the last few (insert measure of time) better awareness and attention given to making information in media available (aka accessible) for the visually impaired, via alt text or image descriptions (not a new topic ’round here). But here is something counter intuitive… I suggest that alt text / media descriptions should […]
- 2016
- Codified, Decodified, Uncodified People doing Bryan Alexander’s Blog Along Book Club reading of We Make the Road by Walking are already done chapter 3! I just made it to the end of the second one, but there was soemthing that jumped out at me towards the end, and that’s always something to pay attention to. (note: I am […]
- 2014
- Hey Mae I keep a TV on mainly as having some background sound so it’s not so empty in this apartment. I was not even watching what I left on, my the tone… the frequency of the actress was so brash, yet alluring. And thus I fell into a Mae West rabbit hole. How little of this […]
- 2012
- Case Closed- Found Camera Returns Home This case is now closed. A found camera left on the Go Train in Toronto, found by Giulia and GNA, has been received by its owners, a family in Germany. cc licensed ( BY NC ND ) flickr photo shared by vic xia Of course, that is not the real camera shown above, it is […]
- 2011
- The Wrong Thing to Boomerang cc licensed ( BY NC SD ) flickr photo shared by Thruhike98 Back in 2007, I had this insane cross country tour of Australia– a fantastic invitation, opportunity, and no second guessing it for a minute.. but it was done as a visit to every capital city in a 2 week time span. I was […]
- Slice of Life 003: Flying into the Future cc licensed ( BY ) flickr photo shared by cogdogblog Here is my Slice fo Life recording from my trip into the future, as our ds106 colleauges west of the international date line refer to it. On Friday, November 25, yes Black Friday, I drove from Strawberry to Phoenix, got a ride to the airport, […]
- 2009
- Map That Package, Please I love being able to track the packages that get shipped to me; living in a rural town blessedly far from malls and mega-shops, I am ordering more and more of my household (and camera toys, computer stuff) items online. Tracking helps, but now I want more, because the detail is not fine grained enough! […]
- 2007
- Lonely Tagger A quiet moment for me posted 17 Dec ’05, 11.38pm MST PST on flickr In the middle of nowhere, so silent you can only hear the blood flowing through your ears. Good job a car is nearby or I’d be in trouble. Hi, my name is Alan, and I am a compulsive del.icio.us tagger. Just […]
- 2004
- Minor Enhancements For Feed2JS I just made an update to our RSS Feed2JS service and free code. This changes will not break any current use, just adds some new options for some of the parameters, including: David Carter-Tod suggested a new line of code that allows the output to use the Atom fields for encoded content. I am not […]
- Helen’s Online Portfolio Adventure The self-proclaimed “grandmother” of electronic portfolios, Helen Barrett has likely the most comprehensive set of resources on her main web site plus her E-Portfolios for Learning blog. Not so evident on the front page of site is a fantastic resource where she has taken the same portfolio content and used it in 22 different eportfolio […]
- Benoit the Denver Cabbie Some recent online discussions on motivation and eportfolios reminded me of an experience back in October at the EDUCAUSE conference…. well actually it had nothing to do with the conference. Towards the conference, I needed to get out to the airport (which seems to be located somewhere in Nebraska) since my wife was flying in […]
- My Portrait Photo You Will Not See on Flickr Last evening I had a digital photo portrait taken by a local photographer but I doubt it will be flattering enough to land on my flickr collection… I never saw the photographer, but I have been aware of where they set up their studios. Yes, I managed to have a snapshot taken of not only […]
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 December 2nd
- 2023
- Silly Generators Get Better Sharing Buttons Twis (present tense of “twas”?) not a real big demand on the internet for the kind of silly randomness I spat out to make a web toy that generates random utterances about AI using the quotes of Agent 007’s gadget master, Q. And there’s still place and value to do these things without just reachhig […] ➡
- 2022
- Should Alt Text be Visible/Accessible for All? There has been over the last few (insert measure of time) better awareness and attention given to making information in media available (aka accessible) for the visually impaired, via alt text or image descriptions (not a new topic ’round here). But here is something counter intuitive… I suggest that alt text / media descriptions should […] ➡
- 2016
- Codified, Decodified, Uncodified People doing Bryan Alexander’s Blog Along Book Club reading of We Make the Road by Walking are already done chapter 3! I just made it to the end of the second one, but there was soemthing that jumped out at me towards the end, and that’s always something to pay attention to. (note: I am […] ➡
- 2014
- Hey Mae I keep a TV on mainly as having some background sound so it’s not so empty in this apartment. I was not even watching what I left on, my the tone… the frequency of the actress was so brash, yet alluring. And thus I fell into a Mae West rabbit hole. How little of this […] ➡
- 2012
- Case Closed- Found Camera Returns Home This case is now closed. A found camera left on the Go Train in Toronto, found by Giulia and GNA, has been received by its owners, a family in Germany. cc licensed ( BY NC ND ) flickr photo shared by vic xia Of course, that is not the real camera shown above, it is […] ➡
- 2011
- The Wrong Thing to Boomerang cc licensed ( BY NC SD ) flickr photo shared by Thruhike98 Back in 2007, I had this insane cross country tour of Australia– a fantastic invitation, opportunity, and no second guessing it for a minute.. but it was done as a visit to every capital city in a 2 week time span. I was […] ➡
- Slice of Life 003: Flying into the Future cc licensed ( BY ) flickr photo shared by cogdogblog Here is my Slice fo Life recording from my trip into the future, as our ds106 colleauges west of the international date line refer to it. On Friday, November 25, yes Black Friday, I drove from Strawberry to Phoenix, got a ride to the airport, […] ➡
- 2009
- Map That Package, Please I love being able to track the packages that get shipped to me; living in a rural town blessedly far from malls and mega-shops, I am ordering more and more of my household (and camera toys, computer stuff) items online. Tracking helps, but now I want more, because the detail is not fine grained enough! […] ➡
- 2007
- Lonely Tagger A quiet moment for me posted 17 Dec ’05, 11.38pm MST PST on flickr In the middle of nowhere, so silent you can only hear the blood flowing through your ears. Good job a car is nearby or I’d be in trouble. Hi, my name is Alan, and I am a compulsive del.icio.us tagger. Just […] ➡
- 2004
- Minor Enhancements For Feed2JS I just made an update to our RSS Feed2JS service and free code. This changes will not break any current use, just adds some new options for some of the parameters, including: David Carter-Tod suggested a new line of code that allows the output to use the Atom fields for encoded content. I am not […] ➡
- Helen’s Online Portfolio Adventure The self-proclaimed “grandmother” of electronic portfolios, Helen Barrett has likely the most comprehensive set of resources on her main web site plus her E-Portfolios for Learning blog. Not so evident on the front page of site is a fantastic resource where she has taken the same portfolio content and used it in 22 different eportfolio […] ➡
- Benoit the Denver Cabbie Some recent online discussions on motivation and eportfolios reminded me of an experience back in October at the EDUCAUSE conference…. well actually it had nothing to do with the conference. Towards the conference, I needed to get out to the airport (which seems to be located somewhere in Nebraska) since my wife was flying in […] ➡
- My Portrait Photo You Will Not See on Flickr Last evening I had a digital photo portrait taken by a local photographer but I doubt it will be flattering enough to land on my flickr collection… I never saw the photographer, but I have been aware of where they set up their studios. Yes, I managed to have a snapshot taken of not only […] ➡
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.