“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 17 posts previously published on July 14th

  • 2014
    • Feed WordPress 101: The Basics This is part 1 of 5 in a series of posts for Building Connected Courses: Feed WordPress 101 »» Basic Concepts of Syndication «« – and what to think about even before you touch that WordPress thing Installing and Setting up Feed WordPress – Minimal settings, and planning the way content is sliced, diced, and […]
    • Building Connected Courses: Feed WordPress 101 This is the first in a series of posts meant as a guide for almost anyone to create a WordPress site that operates as a networked hub for content created elsewhere. This is the engine, the Jim Groom Syndication Bus that drives ds106, the Open Digital Storytelling course/community/space. It is intended primarily for Connected Courses, […]
  • 2013
    • Hey! Who Put the Bokeh Under My Deck? Maybe the best photographic advice I came across (forgetting the source) is to “Look for the light”. At first, this might seem the textbook kind of suggestion of always having the light come from behind. But this is different. Look for interesting light. This means looking for both the vivid light of sunrise/sunset, the diffuse [...]
    • Together Alone I’ve just got one week’s reading and discussion in, but I am enjoying the reading group that Ben Rimes has organized as Book CLub 106 (yes the connection to ds106 may be a thread, but it works for me!). I do not think I have ever been part of any kind of book club… oh […]
    • ds106 Daily Create Challenge (14): I See Eye cc licensed ( BY SA ) flickr photo shared by Alan Levine Today’s ds106 Daily Create is a Drawing challenge, for which, as usual I reach for the Paper 53 app on my iPad. Make a detailed drawing of one of your own eyes. My plan was to take a self photo with my iPhone […]
    • Remembering “Granny” cc licensed ( BY SA ) flickr photo shared by Alan Levine Today marks 10 years since my grandmother passed away. I had always told her I expected her to live to be 100, and she came darn close at 98, so I will round it up, and call it achieved. I spent a chunk […]
  • 2012
    • Day 2: No Human Artifacts Daily Create Challenge So it’s the second day of the Daily Create Seven Day Challenge, another photo assignment to take a photo of a natural scene without any human artifacts. It should make you think about how big or small natural areas are… and also, a question of even natural looking areas, aren’t they affected by human activity? […]
  • 2010
    • Seeking a New Round of Amazing Stories It’s me again, asking you, my dedicated readers (Hi Mom) to help paint this really cool white fence. This is for a presentation my friend and colleague John Ittelson asked me to assist with (I bet more of you know John than me, but ask me sometime to tell the story of the lunch we […]
  • 2009
    • Tech Glory Days (stuff that gets spammed) cc licensed flickr photo shared by natebeaty I had a friend was a big dot com player back in the bubble He could throw that IPO by you Make you look like a fool boy Saw him the other night at this coffee bar I was walking in, he was walking out We went back […]
    • Granny’s Stories Today was the day seven years ago my grandmother passed away. When exactly she was born (sometime in 1905) is a matter of fuzzy record, as she herself told, as her birth into a family of 7 siblings raised by her father in Newark, New Jersey was certified more 50 years later through research into […]
  • 2007
    • Time for a Twitter Blog Post It’s just an un-scientific hunch, but twitter seems to “got game”. Jaiku flickered and faded. Pownce came out with a nice interface, threads, but I’m still tuned to twitter. It’s this dog’s rule that there is never a ‘best’ technology, just the one you happen to be using at the time. It’s going to all […]
  • 2006
    • Rendering RSS inside Media Wiki I’m just getting my feet wet with customizing MediaWiki for several NMC projects- sure it is easy to set up and install out of the box, dump the flower logo for your own, but there is sure a lot of stuff under the hood. There are a lot of flexible editing codes if you can […]
    • One of Those Days Yesterday was just one of those reverse Midas touch days where every piece of technology I touched, so matter how trivial, seemed to up in flames. It would have been advisable to close the laptop, grab a book, and go outside to sit under a tree… but it was 115 degrees in the shade yesterday, […]
  • 2005
    • Four Full Days at PSU I am sitting here in Cincinnati, Kentucky (Yes, Ohio, the airport has left the state) waiting to go home after the 4 day intense almost boot camp experience of the EDUCAUSE Instructional Technology Leadership Program 2005. And the experience was more intense for the participants than us “faculty” presenters. The vagaries of air flight have […]
  • 2004
    • Pounding the Jade Server Crikies! We just got around to setting up AWstats for our “Jade” server that runs our blogs as well as the Feed2JS contraption. For just a week of running, in the middle of a hot and slow summer, we see: 561,000 hits (42k per day) 99,000 unique visitors (11k per day) It turns out 96% […]
    • Fugu Rocks sFTP- better than the Captain, The Dud, The Truck, The Duck More and more I have needed a Mac OSX SFTP client for moving web content to various servers- we have knocked off open FTP on all of our web servers, and I need it now for loading content to SourceForge. Pity that my long friend Fetch, used since the early 1990s, has yet to jump […]
  • 2003
    • DirectorWeb sports a new RSS feed I have just hacked together a script to generate RSS feeds for the items posted to the front of Director Web, our long standing web resource site for users of Macromedia Director. Although, I have not touched the inside of Director for about a year or two, this site still generates a pile of traffic, […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 17 posts previously published on July 14th

  • 2014
    • Feed WordPress 101: The Basics This is part 1 of 5 in a series of posts for Building Connected Courses: Feed WordPress 101 »» Basic Concepts of Syndication «« – and what to think about even before you touch that WordPress thing Installing and Setting up Feed WordPress – Minimal settings, and planning the way content is sliced, diced, and […] &amp#x27A1;
    • Building Connected Courses: Feed WordPress 101 This is the first in a series of posts meant as a guide for almost anyone to create a WordPress site that operates as a networked hub for content created elsewhere. This is the engine, the Jim Groom Syndication Bus that drives ds106, the Open Digital Storytelling course/community/space. It is intended primarily for Connected Courses, […] &amp#x27A1;
  • 2013
    • Hey! Who Put the Bokeh Under My Deck? Maybe the best photographic advice I came across (forgetting the source) is to “Look for the light”. At first, this might seem the textbook kind of suggestion of always having the light come from behind. But this is different. Look for interesting light. This means looking for both the vivid light of sunrise/sunset, the diffuse [...] &amp#x27A1;
    • Together Alone I’ve just got one week’s reading and discussion in, but I am enjoying the reading group that Ben Rimes has organized as Book CLub 106 (yes the connection to ds106 may be a thread, but it works for me!). I do not think I have ever been part of any kind of book club… oh […] &amp#x27A1;
    • ds106 Daily Create Challenge (14): I See Eye cc licensed ( BY SA ) flickr photo shared by Alan Levine Today’s ds106 Daily Create is a Drawing challenge, for which, as usual I reach for the Paper 53 app on my iPad. Make a detailed drawing of one of your own eyes. My plan was to take a self photo with my iPhone […] &amp#x27A1;
    • Remembering “Granny” cc licensed ( BY SA ) flickr photo shared by Alan Levine Today marks 10 years since my grandmother passed away. I had always told her I expected her to live to be 100, and she came darn close at 98, so I will round it up, and call it achieved. I spent a chunk […] &amp#x27A1;
  • 2012
    • Day 2: No Human Artifacts Daily Create Challenge So it’s the second day of the Daily Create Seven Day Challenge, another photo assignment to take a photo of a natural scene without any human artifacts. It should make you think about how big or small natural areas are… and also, a question of even natural looking areas, aren’t they affected by human activity? […] &amp#x27A1;
  • 2010
    • Seeking a New Round of Amazing Stories It’s me again, asking you, my dedicated readers (Hi Mom) to help paint this really cool white fence. This is for a presentation my friend and colleague John Ittelson asked me to assist with (I bet more of you know John than me, but ask me sometime to tell the story of the lunch we […] &amp#x27A1;
  • 2009
    • Tech Glory Days (stuff that gets spammed) cc licensed flickr photo shared by natebeaty I had a friend was a big dot com player back in the bubble He could throw that IPO by you Make you look like a fool boy Saw him the other night at this coffee bar I was walking in, he was walking out We went back […] &amp#x27A1;
    • Granny’s Stories Today was the day seven years ago my grandmother passed away. When exactly she was born (sometime in 1905) is a matter of fuzzy record, as she herself told, as her birth into a family of 7 siblings raised by her father in Newark, New Jersey was certified more 50 years later through research into […] &amp#x27A1;
  • 2007
    • Time for a Twitter Blog Post It’s just an un-scientific hunch, but twitter seems to “got game”. Jaiku flickered and faded. Pownce came out with a nice interface, threads, but I’m still tuned to twitter. It’s this dog’s rule that there is never a ‘best’ technology, just the one you happen to be using at the time. It’s going to all […] &amp#x27A1;
  • 2006
    • Rendering RSS inside Media Wiki I’m just getting my feet wet with customizing MediaWiki for several NMC projects- sure it is easy to set up and install out of the box, dump the flower logo for your own, but there is sure a lot of stuff under the hood. There are a lot of flexible editing codes if you can […] &amp#x27A1;
    • One of Those Days Yesterday was just one of those reverse Midas touch days where every piece of technology I touched, so matter how trivial, seemed to up in flames. It would have been advisable to close the laptop, grab a book, and go outside to sit under a tree… but it was 115 degrees in the shade yesterday, […] &amp#x27A1;
  • 2005
    • Four Full Days at PSU I am sitting here in Cincinnati, Kentucky (Yes, Ohio, the airport has left the state) waiting to go home after the 4 day intense almost boot camp experience of the EDUCAUSE Instructional Technology Leadership Program 2005. And the experience was more intense for the participants than us “faculty” presenters. The vagaries of air flight have […] &amp#x27A1;
  • 2004
    • Pounding the Jade Server Crikies! We just got around to setting up AWstats for our “Jade” server that runs our blogs as well as the Feed2JS contraption. For just a week of running, in the middle of a hot and slow summer, we see: 561,000 hits (42k per day) 99,000 unique visitors (11k per day) It turns out 96% […] &amp#x27A1;
    • Fugu Rocks sFTP- better than the Captain, The Dud, The Truck, The Duck More and more I have needed a Mac OSX SFTP client for moving web content to various servers- we have knocked off open FTP on all of our web servers, and I need it now for loading content to SourceForge. Pity that my long friend Fetch, used since the early 1990s, has yet to jump […] &amp#x27A1;
  • 2003
    • DirectorWeb sports a new RSS feed I have just hacked together a script to generate RSS feeds for the items posted to the front of Director Web, our long standing web resource site for users of Macromedia Director. Although, I have not touched the inside of Director for about a year or two, this site still generates a pile of traffic, […] &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 *