“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 19 posts previously published on February 19th

  • 2023
    • Flickr Flips the Longitude: Greetings from Botsiy, Russia Flickr does some very fun things for me, and my pink and blue dot loyalty planted in March 2004 remains true. One of the fun things it has done numerous times over the past 6+ years is, without much a recognizable pattern, decides to locate my photos somewhere in rural China and remote regions of […]
    • Back to the AI Past: ChatGPT and ELIZA on a Blind Date Perhaps there needs to be more romance in the world of Artificial Intelligence? For a while, I had some thoughts back to good old ELIZA. What does she think of all this stuff? Most likely she would not say but deflect back with more questions. I had not realized … that extremely short exposures to […]
  • 2021
    • Bringing the Kitchen to Arizona The sounds and smells from the H5P/PB Kitchen are detected in far away places. Today I was fortunate to bring the concept, support model. and examples from our…
  • 2018
    • CogDog It Company Report Maybe it’s that impending tax time of the year. As an independent self-employed company of (rounding up) 1.0 I start the tax forms around now, just in case it looks like a refund might be in the works. If the numbers tilt the other way, as it looks, I shelve it til April. My friend […]
    • Can Wordprezz Embedz GIF? It seems like WordPress can auto-embed giphy URLS although it is not a service listed in the codex. Nicely done, WordPress, nice. Yup that is an auto-embed simply by putting on a blank line: https://giphy.com/gifs/9D1k9OnAkt4zWXvuAf Look out!  Share this barking on social media
  • 2017
    • A New Dimension of a WordPress Theme I’m fairly sure this blog post and the README write up a new WordPress Theme are going to take as long as it took to do the coding. That’s okay, it’s important. The path I took was similar when I was looking for a simple landing for the main site of the WordPress Multisite for […]
  • 2016
    • A Catfishing Page Tonight I got another distraught and ashamed email (“You must think I’m stupid”) (No I do not). This message someone who just had the veil lifted from their eyes and found they were a victim of a catfishing scam from a fake person wearing my photos. I decided to copy Alec Corous and set up […]
    • Doling Out URLs Still in Style This morning’s “do the math and taste your antiquity moment” was before a workshop here at Universidad del Sagrado Corazón. In the euphoria of my first year on the web (which is honestly still euphoric) my first presentation about the web (and also on the web) was Providing Structured Multimedia Learning Environments- Mosaic for the […]
    • A Farce Performance: Honor a Request to Remove Old Blog Comment Spam? Believe it or not, web kids, there was a time when you could put a form on a web site with a text area and not worry about people blitzing it with spurious irrelevant links to Chinese metal manufacturing companies, porn, pharmaceutical supplies, etc. What Google provided us in search results rests upon an economic […]
  • 2013
  • 2012
    • Week 5 in Review This past week’s Daily Creates I seemed to have done more this week with my iPhone camera than my DSLR, and dod a bit more experimenting or playing with 2 apps – PhotoGene for editing and ToonCamera for making cartoon effects.  Share this barking on social media
    • Get Infected ds106 Propaganda posters— they seem to be calling from many places; I came across a great collection at Shorpy (another mint archive for visuals from the past). Hence a warning poster about ds106: This one was rather easy to work with- the original poster was a warning against the dangers of syphilis: The backgrounds of […]
  • 2008
    • Jane… er, Google, Stop This Crazy Machine Even with spam fighting plugins, on a daily basis, I am spending time I’d rather be doing sometime constructive, and deleting, moderating, click through the relentless barrage of blog comment spam. I am feeling like the dutch boy and I am getting weary of trying to hold back the dam. The killer was one that […]
  • 2005
    • I Wish I Were Canadian I am soooooo envious: Northern Voice Blog Conference  Share this barking on social media
    • Podcaster Request: Feed With a Summary I continue to put my pennies in a piggy bank towards a future iPod. Until then, in scanning more and more RSS feeds that contain references to the audio enclosures, I am bothered/irked/annoyed by the scant details available to the summary in an RSS Reader: My Views on the Cheese Curdling Controversy Today’s podcast on […]
    • I Can Snow If I Want To flickr foto I Can Snow If I Want Toavailable on my flickr The thermometer is pegging 35+ degrees, but snow is falling in nice big clumps this morning at our cabin in Strawberry. A big wet storm is sitting on top of Arizona, the second in a week (I am convinced somehow our weather delivery […]
  • 2004
    • Syllabus onTrackBack: What Train? Wrong Track? Just getting bounced around RSS-space is Phil Long’s Syllabus Feb 2004 column on TrackBack: Where Blogs Learn Their Places . Some are saying tat it explains Trackback well, but to be honest, you cannot really understand it until you use it. We are glad that Phil is giving TrackBack some limelight (waiting for those to […]
    • Ahhh, this Makes RSS More Understandable Amy Gahran, publisher of CONTENTIOUS (all caps) thinks RSS is confusing because of the acronym. So she is running a “contest” aimed to “rename” RSS (this dog thinks the cat, er, meme, is out of the bag). So here is the update on the “front-runners”, and judge for yourself how much the label affects the […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 19 posts previously published on February 19th

  • 2023
    • Flickr Flips the Longitude: Greetings from Botsiy, Russia Flickr does some very fun things for me, and my pink and blue dot loyalty planted in March 2004 remains true. One of the fun things it has done numerous times over the past 6+ years is, without much a recognizable pattern, decides to locate my photos somewhere in rural China and remote regions of […] &amp#x27A1;
    • Back to the AI Past: ChatGPT and ELIZA on a Blind Date Perhaps there needs to be more romance in the world of Artificial Intelligence? For a while, I had some thoughts back to good old ELIZA. What does she think of all this stuff? Most likely she would not say but deflect back with more questions. I had not realized … that extremely short exposures to […] &amp#x27A1;
  • 2021
  • 2018
    • CogDog It Company Report Maybe it’s that impending tax time of the year. As an independent self-employed company of (rounding up) 1.0 I start the tax forms around now, just in case it looks like a refund might be in the works. If the numbers tilt the other way, as it looks, I shelve it til April. My friend […] &amp#x27A1;
    • Can Wordprezz Embedz GIF? It seems like WordPress can auto-embed giphy URLS although it is not a service listed in the codex. Nicely done, WordPress, nice. Yup that is an auto-embed simply by putting on a blank line: https://giphy.com/gifs/9D1k9OnAkt4zWXvuAf Look out!  Share this barking on social media &amp#x27A1;
  • 2017
    • A New Dimension of a WordPress Theme I’m fairly sure this blog post and the README write up a new WordPress Theme are going to take as long as it took to do the coding. That’s okay, it’s important. The path I took was similar when I was looking for a simple landing for the main site of the WordPress Multisite for […] &amp#x27A1;
  • 2016
    • A Catfishing Page Tonight I got another distraught and ashamed email (“You must think I’m stupid”) (No I do not). This message someone who just had the veil lifted from their eyes and found they were a victim of a catfishing scam from a fake person wearing my photos. I decided to copy Alec Corous and set up […] &amp#x27A1;
    • Doling Out URLs Still in Style This morning’s “do the math and taste your antiquity moment” was before a workshop here at Universidad del Sagrado Corazón. In the euphoria of my first year on the web (which is honestly still euphoric) my first presentation about the web (and also on the web) was Providing Structured Multimedia Learning Environments- Mosaic for the […] &amp#x27A1;
    • A Farce Performance: Honor a Request to Remove Old Blog Comment Spam? Believe it or not, web kids, there was a time when you could put a form on a web site with a text area and not worry about people blitzing it with spurious irrelevant links to Chinese metal manufacturing companies, porn, pharmaceutical supplies, etc. What Google provided us in search results rests upon an economic […] &amp#x27A1;
  • 2013
  • 2012
    • Week 5 in Review This past week’s Daily Creates I seemed to have done more this week with my iPhone camera than my DSLR, and dod a bit more experimenting or playing with 2 apps – PhotoGene for editing and ToonCamera for making cartoon effects.  Share this barking on social media &amp#x27A1;
    • Get Infected ds106 Propaganda posters— they seem to be calling from many places; I came across a great collection at Shorpy (another mint archive for visuals from the past). Hence a warning poster about ds106: This one was rather easy to work with- the original poster was a warning against the dangers of syphilis: The backgrounds of […] &amp#x27A1;
  • 2008
    • Jane… er, Google, Stop This Crazy Machine Even with spam fighting plugins, on a daily basis, I am spending time I’d rather be doing sometime constructive, and deleting, moderating, click through the relentless barrage of blog comment spam. I am feeling like the dutch boy and I am getting weary of trying to hold back the dam. The killer was one that […] &amp#x27A1;
  • 2005
    • I Wish I Were Canadian I am soooooo envious: Northern Voice Blog Conference  Share this barking on social media &amp#x27A1;
    • Podcaster Request: Feed With a Summary I continue to put my pennies in a piggy bank towards a future iPod. Until then, in scanning more and more RSS feeds that contain references to the audio enclosures, I am bothered/irked/annoyed by the scant details available to the summary in an RSS Reader: My Views on the Cheese Curdling Controversy Today’s podcast on […] &amp#x27A1;
    • I Can Snow If I Want To flickr foto I Can Snow If I Want Toavailable on my flickr The thermometer is pegging 35+ degrees, but snow is falling in nice big clumps this morning at our cabin in Strawberry. A big wet storm is sitting on top of Arizona, the second in a week (I am convinced somehow our weather delivery […] &amp#x27A1;
  • 2004
    • Syllabus onTrackBack: What Train? Wrong Track? Just getting bounced around RSS-space is Phil Long’s Syllabus Feb 2004 column on TrackBack: Where Blogs Learn Their Places . Some are saying tat it explains Trackback well, but to be honest, you cannot really understand it until you use it. We are glad that Phil is giving TrackBack some limelight (waiting for those to […] &amp#x27A1;
    • Ahhh, this Makes RSS More Understandable Amy Gahran, publisher of CONTENTIOUS (all caps) thinks RSS is confusing because of the acronym. So she is running a “contest” aimed to “rename” RSS (this dog thinks the cat, er, meme, is out of the bag). So here is the update on the “front-runners”, and judge for yourself how much the label affects the […] &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 *