“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.

Red arrow points to missing number where the page output reads "There are posts previously published on December 29th"

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.

https://twitter.com/djwudi/status/1212871226953101313

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 16 posts previously published on December 29th

  • 2021
    • Making > Taking You might suspect this blog is solely about photos and images, and openness thereof. Maybe it is, as this post that has been tap tap tapping inside the head today follows (reversing the reverse blog chronology) of yesterday’s experiment with end-arounding Google Image search and the day before’s waxing on photo making. I’ve likely blabbed […]
  • 2020
    • Open Not Being the Same as Free, Hence Two Flickr Photo Collections One holiday activity has been some overdue clean up of my pile of flickr photos. It’s time soon to package my album of daily photos for 2020 into a video (again using a magical script by John Johnston). I rarely am at 100% for a year- it happened once. But this year, as always, I […]
  • 2018
    • Reviving the 1990s EduWeb: Teaching & Learning on WWW site All of my web work from 1992-2006 at the Maricopa Community Colleges was wiped from the web after I left. It was big pile of stuff for sure but it was the first of several experiences which informed me that institutions care about preserving the web much less than individuals. But when I left that […]
  • 2014
    • Tweaking TRU Writer / Coding By No Textbook In some reference of software design, there’s a process where you figure out all the features you might need, plant it all out neatly, build it, and then go into some cycle of testing and debugging. Then you roll it out, tweet it, and … well I don’t really know how it works. In my […]
    • Voices from Aisquith Street Perhaps the most treasured digital bits I have is the hour of audio recorded of my Mom telling stories of her growing up in Baltimore in the 1930s. I recorded this on a visit after after her 80th birthday; and was on my way to visit some 18 months after when she passed away unexpectedly. […]
  • 2013
    • Backdooring a WordPress User Admin Account cc licensed ( BY NC SA ) flickr photo shared by amanda tipton Understanding some of the database structure of wordpress can help you out of some jams. Ot maybe make some new ones. I had a recent situation that may never happen for someone else, but knowing something about the way WordPress stories user […]
    • History is Never That Simple cc licensed ( BY SA ) flickr photo shared by Alan Levine My dimly remembered history of learning world history paints the age of discovery as some sort of pure pursuit of mapping the world, with captains mumbling something akin to the opening to Star Trek. Columbus knew the world was not flat! (so did […]
  • 2012
    • GIF ’em High This next phase of GIFfest 2012 returns to the movies, and the westerns, with some slices of Hang ’em High, the 1968 western notable because it was the first one of Clint Eastwood’s westerns that was not filmed in Italy. I’ve already noted GIFfed some of the continuity problems in the opening credits, now let’s […]
  • 2011
    • Photo Word Translation (new ds106 assignment) Having tossed down a gauntlet on assignment creation, I could sit idly without bring some more “A Game”. Here ny example for a new assignment based on illustrating words that have no English translation. Glas Web “A smile that is insincere or mocking. Literally, a blue smile.”cc licensed ( BY ) flickr photo by babasteve: […]
    • Bring Your A Game to ds106 Assignments cc licensed ( BY ) flickr photo shared by Gamma Man Among my favorite echos of Jim Groom-isms is the approach of bringing your “A” Game to whatever you do- be it presentations, animated GIFs, radio shows. Don’t just show up with your average stuff if you want to play in big leagues. So I […]
  • 2010
    • An Unscientific Experiment in Recommendations cc licensed flickr photo shared by Andreas Kristensson I am stepping inside the CogDog Laboratory today to conduct some experiments in… oh who am I kidding? I am just idly watching snow fall out the window, and thinking of things to try out online. Okay, for you loyal reader of this blog (not the use […]
  • 2008
    • Shining a Light: Icelandair Pockets My Money Did you know that airlines can take your money for tickets, and then keep it when their own delays cause you to miss connections? There is a word for that. Did you know they can ignore requests for customer service? Not reply to messages they acknowledge they will? Did you know that the Bush administration […]
    • Customize Your TwitterTools Prefix Text Do you use the TwitterTools plugin on your own WordPress site to send your blog posts to your tweet stream? Wanna feel like a real WordPress hack jockey? Here is a little code editing you can do without needing to know diddly squat about PHP. Here’s the thing, when TwitterTools published your new sexy blog […]
  • 2005
    • Kiwi Artichoke Barks At Learning Objects Wow, and some people think I have an edgy tone in this here blog, especially towards the sacred cow of reusable learning objects, which frankly after several years of looking at, thinking at, I just still do not buy. Yes, RLOs are R.I.P and I have questions lke If All The Learning Objects Are Web […]
    • RipMix Textbooks? If anything seems an underlying techno theme of 2005, for me it is a subtle, unlabeled series of tools, services, that are breaking content apart, and re-assembling it into new. Rather than coining a jargon, it seems to becoming more of a broader mindset of looking at information differently. I’ve enough suggested this under the […]
  • 2004
    • More Free, Open Text In addition to interesting initiatives such as WikiBooks to publish free content, comes this interesting announcement from the giant Internet Archive: International Libraries and the Internet Archive collaborate to build Open-Access Text Archives Today, a number of International libraries have committed to putting their digitized books in open-access archives, starting with one at the Internet […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 16 posts previously published on December 29th

  • 2021
    • Making > Taking You might suspect this blog is solely about photos and images, and openness thereof. Maybe it is, as this post that has been tap tap tapping inside the head today follows (reversing the reverse blog chronology) of yesterday’s experiment with end-arounding Google Image search and the day before’s waxing on photo making. I’ve likely blabbed […] &amp#x27A1;
  • 2020
  • 2018
    • Reviving the 1990s EduWeb: Teaching & Learning on WWW site All of my web work from 1992-2006 at the Maricopa Community Colleges was wiped from the web after I left. It was big pile of stuff for sure but it was the first of several experiences which informed me that institutions care about preserving the web much less than individuals. But when I left that […] &amp#x27A1;
  • 2014
    • Tweaking TRU Writer / Coding By No Textbook In some reference of software design, there’s a process where you figure out all the features you might need, plant it all out neatly, build it, and then go into some cycle of testing and debugging. Then you roll it out, tweet it, and … well I don’t really know how it works. In my […] &amp#x27A1;
    • Voices from Aisquith Street Perhaps the most treasured digital bits I have is the hour of audio recorded of my Mom telling stories of her growing up in Baltimore in the 1930s. I recorded this on a visit after after her 80th birthday; and was on my way to visit some 18 months after when she passed away unexpectedly. […] &amp#x27A1;
  • 2013
    • Backdooring a WordPress User Admin Account cc licensed ( BY NC SA ) flickr photo shared by amanda tipton Understanding some of the database structure of wordpress can help you out of some jams. Ot maybe make some new ones. I had a recent situation that may never happen for someone else, but knowing something about the way WordPress stories user […] &amp#x27A1;
    • History is Never That Simple cc licensed ( BY SA ) flickr photo shared by Alan Levine My dimly remembered history of learning world history paints the age of discovery as some sort of pure pursuit of mapping the world, with captains mumbling something akin to the opening to Star Trek. Columbus knew the world was not flat! (so did […] &amp#x27A1;
  • 2012
    • GIF ’em High This next phase of GIFfest 2012 returns to the movies, and the westerns, with some slices of Hang ’em High, the 1968 western notable because it was the first one of Clint Eastwood’s westerns that was not filmed in Italy. I’ve already noted GIFfed some of the continuity problems in the opening credits, now let’s […] &amp#x27A1;
  • 2011
    • Photo Word Translation (new ds106 assignment) Having tossed down a gauntlet on assignment creation, I could sit idly without bring some more “A Game”. Here ny example for a new assignment based on illustrating words that have no English translation. Glas Web “A smile that is insincere or mocking. Literally, a blue smile.”cc licensed ( BY ) flickr photo by babasteve: […] &amp#x27A1;
    • Bring Your A Game to ds106 Assignments cc licensed ( BY ) flickr photo shared by Gamma Man Among my favorite echos of Jim Groom-isms is the approach of bringing your “A” Game to whatever you do- be it presentations, animated GIFs, radio shows. Don’t just show up with your average stuff if you want to play in big leagues. So I […] &amp#x27A1;
  • 2010
    • An Unscientific Experiment in Recommendations cc licensed flickr photo shared by Andreas Kristensson I am stepping inside the CogDog Laboratory today to conduct some experiments in… oh who am I kidding? I am just idly watching snow fall out the window, and thinking of things to try out online. Okay, for you loyal reader of this blog (not the use […] &amp#x27A1;
  • 2008
    • Shining a Light: Icelandair Pockets My Money Did you know that airlines can take your money for tickets, and then keep it when their own delays cause you to miss connections? There is a word for that. Did you know they can ignore requests for customer service? Not reply to messages they acknowledge they will? Did you know that the Bush administration […] &amp#x27A1;
    • Customize Your TwitterTools Prefix Text Do you use the TwitterTools plugin on your own WordPress site to send your blog posts to your tweet stream? Wanna feel like a real WordPress hack jockey? Here is a little code editing you can do without needing to know diddly squat about PHP. Here’s the thing, when TwitterTools published your new sexy blog […] &amp#x27A1;
  • 2005
    • Kiwi Artichoke Barks At Learning Objects Wow, and some people think I have an edgy tone in this here blog, especially towards the sacred cow of reusable learning objects, which frankly after several years of looking at, thinking at, I just still do not buy. Yes, RLOs are R.I.P and I have questions lke If All The Learning Objects Are Web […] &amp#x27A1;
    • RipMix Textbooks? If anything seems an underlying techno theme of 2005, for me it is a subtle, unlabeled series of tools, services, that are breaking content apart, and re-assembling it into new. Rather than coining a jargon, it seems to becoming more of a broader mindset of looking at information differently. I’ve enough suggested this under the […] &amp#x27A1;
  • 2004
    • More Free, Open Text In addition to interesting initiatives such as WikiBooks to publish free content, comes this interesting announcement from the giant Internet Archive: International Libraries and the Internet Archive collaborate to build Open-Access Text Archives Today, a number of International libraries have committed to putting their digitized books in open-access archives, starting with one at the Internet […] &amp#x27A1;
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.

    If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
    Become a patron at Patreon!
    Profile Picture for CogDog The Blog
    An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

    Leave a Reply

    Your email address will not be published. Required fields are marked *