7 Minute Miles

Code is Power

Posted Wednesday, December 7th, 2016 11:24 pm GMT -5 in Housekeeping, Personal, Technology

When my automated Twitter plugins stopped working last week, I started thinking about ways to replace the tweet section at the top of 7 Minute Miles. Twitter Tools and Social used to pull in the last 7 tweets automatically, but the plugin authors decided to stop supporting them back in February (RIP Alex King). Twitter also seems to change up their developer connections from time to time, so all plugins will break at some point if they aren’t maintained.

Since the updates stopped, I learned that my wife and dad both read that section regularly for information instead of visiting Twitter itself. I looked at a lot of other Twitter WordPress plugins and couldn’t find anything that did exactly the same thing as Twitter Tools, so I looked at other ways to incorporate tweets into this site.

What I’ve decided to try is a new, automated post for each tweet. I’ve installed the Import Tweets as Posts plugin by Chandan Kumar and modified it to change the post format to “status.” It’s set to look for new tweets every two minutes and assign each post to a new “tweets” category.

I had to modify my functions.php file to add status to the post-formats array and wrote some new code for the homepage to style the display of these new tweet posts. The plugin even supports URL links and sets attached photos as the featured image. I’ll still need to find a way to automatically send links of full posts to Twitter, but this works for now.

Code rules…

Originally published by DK on December 7, 2016 at 11:24 pm
 

DK Avatar
Email DK 7 Minute Miles RSS Feed
612.224.5422

Personal Records & Mileage

  • Mile - 6:10
  • 5K - 21:42
  • 10K - 44:40
  • Half - 1:38:40
  • Marathon - 3:43:32
  • 2018 Run Mileage: 120.7
  • 2018 Bike Mileage: 928.7

Search 7 Minute Miles