Hack

Greetings Library Scientist

The California Library Association is pretty much like every other regional library association I’ve seen, not least because their most visible presence is their annual conference. It may be the season, but the CLA is more politically active than others I’ve known. At their core, most such associations exist to promote efficient transfer of operational knowledge from […] » about 800 words

Improving Will Norris’ Open Graph Plugin

Will Norris put together a nice WordPress plugin to place Open Graph metadata on the page. Today I patched it to address a few bugs I and others have found.

The patch switches functions that depended on globalizing $post to use $wp_query->queried_object and similar.

opengraph_default_url() is changed to try get_permalink() only when is_singlular() is true. Otherwise it uses the blog’s base URL. This isn’t perfect, but it’s better than having the front page and all tag/category/archive pages report their og:url as being the permalink for the first post on the page.

As suggested here, I changed the opengraph_default_description() to use the post’s excerpt if is_singular() and the post includes an excerpt.

I changed opengraph_default_image() to test if the theme supports post thumbnails before calling has_post_thumbnail() to avoid the Fatal error: Call to undefined function has_post_thumbnail() errors.

I submitted it as a bug report in the plugins Trac, but I don’t check there for tickets on my own plugins, so you might apply the patch yourself.

WordPress Hacks: Nested Paths For WPMU Blogs

Situation: you’ve got WordPress Multi-User setup to host one or more domains in sub-directory mode (as in site.org/blogname), but you want a deeper directory structure than WPMU allows…something like the following examples, perhaps: site.org/blogname1 site.org/departments/blogname2 site.org/departments/blogname3 site.org/services/blogname3 The association between blog IDs and sub-directory paths is determined in wpmu-settings.php, but the code there knows nothing […] » about 900 words

Google Minus Google

From The Register: Inspired by a recent New York Times piece that questioned whether the Mountain View search monopoly is morphing into a media company — which it is — Finnish blogger Timo Paloheimo promptly unveiled Google minus Google. Key in the word “YouTube,” and the first result is Wikipedia. » about 100 words