WordPress 3.3.1 Upgrade Fail on Lighttpd

We run all of our blogs using WordPress.  Wordpress.org releases updates to their software on a regular basis, adding new features, making it more secure, faster etc.  Normally upgrading is just a matter of downloading the new source code, testing it out on a dev server, then deploying it on our live servers.

Just recently when we upgraded to version 3.3.1 this process didn’t go as smoothly as it normally does and I’d like to briefly document here what the issue was for the benefit of other people and to remind myself of what happened here for future reference.

After deploying the new version, things looked fine.  Over the next few days, however, problems started to arise.  Scheduled posts were not getting published on time and the local comment sync from Disqus was not working automatically.  This only was occurring on the Streetsblogs, however, and not on GothamSchools. (more…)


Our editors are looking for new ways to create a story by curating social media entries into a linear conversation.  This morning I came across Storify and am very pleased with it.  I was so enthusiastic that I couldn’t help but to whip together a tribute to the great Lionel Messi (to serve as an example!)  To create your own story, simply go to storify.com. You can then easily embed it into your blog, as I have done here:

Measuring Streetfilms’ Success

Streetfilms is in the process of applying for a grant to improve their site.  This poses the question of how do we measure the effectiveness of streetfilms.org so that we can show whether any investment in it pays off?

Streetfilms produces short films showing how smart transportation design and policy can result in better places to live, work and play.  Its goal is to inspire action and behavioral change to make the cities of the world more livable.

So how do we measure Streetfilms’ success at achieving this goal?  If we look at how people engage Streetfilms, we can draw a few rough categories of increasing degrees of user engagement: (more…)

Embedding Twitter

Our editors have been asking for a way to embed twitter searches into their blogs.  It turns out it’s really easy.  Twitter offers a number of embeddable widgets.

  1. Log in to Twitter and click on Resources in the right sidebar
  2. Choose Widgets and then click “My Website”
  3. Choose the Search widget or any other widget
  4. Customize then embed!
  5. You may want to add some css on the page to customize the look of the widget. I had to here because my styles were interfering with it a bit.
  6. Edit the settings to set interval: 5000.  This will make the widget update every 5s instead of the default 30s.  You can also adjust the width and height.

The Ultimate WordPress Search

If you’ve been following the story thus far, I’ve been working at refining our search on Streetsblog.  The standard WordPress search only returns results ordered by date, so my first step was to integrate Google Custom Search with Streetsblog.  This works beautifully and should meet the needs of most readers, but soon our editors realized that they’d also like the option of sorting by date.

I played around with biasing the Google search results by date.  This worked fine but, unfortunately, Google searches all site content, including sidebar content and category drop-down lists, when returning results.  So, if you searched for something like a category name, you would essentially end up with a list of all blog posts in reverse chronological order, which is quite useless.

What our editors really wanted was to be able to revert back to the original WordPress search which only searches blog post content.  So I spent some time integrating it with the Google Custom Search interface.  I ended up producing an almost exact replica of the styles and behavior used by Google.  I managed to pull in post thumbnails, to highlight the search term in results, etc.

So now we can search for “bike lanes” by date or by relevance and get useful results for both.  And for anyone else who wants to do this, here’s the code.


Google Custom Search Sort by Date

Google generally sorts search results by relevance.  At times, it gives the option to sort by date.  Sometimes people want the definitive piece of information on a certain topic and other times they just want the most recent piece of information.

A few days ago I rolled out Google Custom Search on Streetsblog as an improvement from the default WordPress search.  It is a streamlined form of the Google search engine that integrates with our sites and displays results by relevance.  After I rolled it out, our editors immediately realized that they wanted to be able to see search results sorted by date as well as relevance.  So I set out to discover how to get Google Custom Search to sort by date.

It turns out that it wasn’t so hard.  I came across this thread explaining how to do it and modified the js code accordingly.  I then put an absolutely-positioned link on the search page:

The link toggles to “sort by relevance” when you are viewing results sorted by date.  Google estimates the date of a particular web page to the best of its ability using content on the page, its url and the first time it was crawled.  The search results appear to be “roughly” sorted by date.

Occasionally certain search results are listed higher than newer ones, perhaps when they are significantly more relevant.  For example, for the search on “bike lanes”, this post was listed above this post even though it was older than it, perhaps because it had 28 comments, much more than the 4 on the more recent post.

Still, hopefully this will meet the needs of our users and help them mine the thousands of posts on Streetsblog.

Better WordPress Search

One of WordPress’ weak points is its search.  Whenever you search for a phrase, it will just return all posts with that word in reverse chronological order.  People are used to the power of Google searches, these days seemingly having the ability to guess exactly where you want to go before you even finish entering the search query.  So, prompted by our Streetsblog editors, I set about to try and improve upon the WordPress default search.

Each time I look into this problem, the landscape is different.  Different plugins are available and Google offers different ways to hook into its API.  This time I was pleased to find a perfect way to offer Google search results on our blogs.  Using Google Custom Search, I created a search engine for each of our sites that restricts its results to just those from the site.  I then customized its look and feel via css in the Streetsblog style sheet.

I ended up with a solution that integrates closely into our blogs:


Motion and Stillness

This video was inspired by the following lines from Eihei Dogen’s Bendowa:

In stillness, mind and object merge in realization and go beyond enlightenment. Nevertheless, in the state of receptive samadhi, without disturbing its quality or moving a single particle you engage the vast buddha activity, the extremely profound and subtle buddha transformation.

I made this video using an iPod Touch and iMovie. The music is Rachmaninoff’s Vocalise, sung by Anna Moffo, and Four Tet, She Moves She.

Related Stories comes to GothamSchools

Over the last few days, I’ve been working with the GothamSchools editors to come up with a way of displaying related stories to readers.  Here is what we’ve come up with:

To accomplish this I started with the same related posts plugin we use on Streetsblog: Yet Another Related Posts Plugin.  This is really an excellent plugin that crunches masses of data to come up with a useful list of related posts for any given post.  By default, it can show this list at the bottom of a post before the comments, or in a sidebar widget.  We soon decided that we didn’t like these options and instead crafted a widget that floated within the story itself. (more…)

Precision Linking

People sometimes ask me, “How do I link to this part of a page, or this paragraph?”  This is useful when you want to direct people to a certain part of a web page or you want to cite from a particular passage of a long post.

The NYTimes has created a sophisticated tool called Emphasis to solve this problem.  If you go to a NYTimes news post and hit the Shift key twice, you’ll expose small paragraph links at the head of each paragraph.  You can fine-tune these links by selecting individual sentences within each paragraph.  The url will change to link directly to that sentence or paragraph:

Amazingly, the NYTimes has open-sourced the code for Emphasis.  I’d be happy to fit this code to our blogs if our editors feel it’ll be useful.  My only hesitation is that adding another js library to our sites would need a thorough round of testing to make sure that it is not conflicting with any of our other libraries.

In the meantime, the easiest way to link to a particular spot in one of our posts, is to edit that post and put an anchor tag at the place where you want to link to, such as this one:

<a name="plink"></a>

Then you can link to that spot on the page like this: http://url.to.page#plink.

Here’s an example of linking directly to the image of this post.  The text “plink” is arbitrary and can be set to anything.