create a private (password-protected) tumblr blog and set up each editor as a contributor to it

private because you don’t want viewers to happen upon the tumblr site (you’ll lose hits on your own site!)

the problem

set up a liveblog on a wordpress site that is easy for multiple authors to contribute to at the same time.

obviously, we can’t have multiple users log into the same page to write content… and these authors will most likely be at a remote location where they may only have their smartphones to make posts.

the solution

authors post on a private tumblr with the tumblr app*

* the tumblr app has some limitations, unfortunately. when posting a link, the app does not extract images or excerpts. it’ll literally just post the link with the page title. however, if you post the link through the website, it’ll look 100x better (test with a twitter or instagram link)

code – php

modify the api.php file like so (i put the tumblr code folder into the theme’s folder — it may be better practice to add it as a plugin just in case you change themes in the future):

these first 2 lines are optional — this is just so you can hook into wordpress’ functions, which are used in the definition of keys — you can hard code those straight into this file if you don’t plan on making changes in the future

specific hashtag for all authors to use in their tumblr posts — so the wordpress page knows what to grab. the default limit is 20. from my tests, the max you can pull at a time is 50, unfortunately

UPDATE: the workaround for the 50 post limit is to set up navigation to show posts older than the 50 that are currently displayed

code – javascript

now we want the post to call it, but not just any post because that would be chaotic. i set up a checkbox custom metabox for a user to check on if the post is going to be used as a liveblog. then i set up a conditional that calls the following

the api will return a series of objects, which you can see in the console log. from there, you can play with the display of each of those objects.

the javascript goes through each object and depending on its type, will display it accordingly. i’m sure it can be cleaned up a bit, but each post type has different attributes which is why there are so many conditionals

don’t forget to set variables for the tumblr url (which can be hard-coded) and the tag that’ll be used, which is a custom metabox for the post

update

this portion will check to see if a querystring is added to the url, in this case, “tumblrpage” (ex: http://gorirrajoe.com/post/?tumblrpage=2 — 2nd page of the tumblr gallery)

the code goes a little bit more in depth with twitter and instagram links because that’s what the client requested — a unique display for those types. you can omit that portion if you don’t need to get so specific:

what good is a liveblog if it doesn’t auto-update? this code is set to make the api call every 5 minutes — it’ll just reload the contents in the ul.liveblog_entries area