tag archive: wordpress

WordPress Plugin: Post Revision Display

I guess July is WordPress plugin month here at movingtofreedom.org, because here comes another one. This one was instigated by another Scott.

Scott Rosenberg wrote last week about the “mutability of online content” and the challenges news organizations face in handling changes and corrections to stories, and concluded that versioning made sense in journalism as a way to build trust. Readers can see all of the changes since publication so that there’s no sense of something being swept under the rug. The Drupal CMS has modules for making revisions publicly viewable, and of course this is a key feature of Wikipedia.

Scott noted that WordPress already stores revisions, and suggested a plugin could make old versions accessible to visitors. Looking to demo the idea on his blog, he later asked if any WordPress developers were intrigued. At first I was only intrigued enough to dig up an existing plugin by D’Arcy Norman that did some of what he was looking for: “Post Revision …

WordPress Plugin: The French Archives

The French are a fine people, but you should be aware that this plugin has nothing to do with France or the French.

Month Grid Archive

I wanted to be able to display my monthly archives in a grid:

With post counts for each month, but wasn’t finding a plugin for it. I did find Rob Marsh’s Compact Archives plugin which gave me a good starting place. (Thanks Rob!)

Along the way, it seemed like it would be nice to have post count totals for each year and a grand total. I think this table gives readers a nice snapshot of posting activity over the years.

It’s simple to use: put the_french_archives.php in your plugin dir, activate it, and put <?php month_grid_archive(); ?> in your template file.

You can optionally specify the month header styles. “abbr” is the default, “initial” shows only the first letter of the month, and “numeric” shows the month number. You can also customize the top row. Default is “Monthly” …

WordPress Plugin, YARQ v3.0: Yet Another Random Quote

This is a plugin/widget to show random quotes on your blog. Frank van den Brink originally created it and Christian Beer has also contributed. The wordpress.org homepage is here: Yet Another Random Quote.

I like this plugin, even if very few people around here can be bothered to actually click on a link to see my random quotes. Really, it’s okay. It’s just fine if you don’t give a rat’s ass about my collected pearls of wit, wisdom, and pop culture ephemera. (You probably won’t care to read my old YARQ post either.)

It appears that the plugin hasn’t been actively maintained, but through the miracle of free software I’ve been able to make my own fixes and enhancements, and now I can share them with you and the world. (I did get in contact with Christian, so we’ll see what we can do about updating the official plugin page.)

YARQ v3.0 works with WordPress 3.0 (for me, anyway), and I suspect will work with WP 2.5 …

No More ‘Curly Quotes’ in WordPress

I’m ditching curly quotes. If you’ve come across this post via a web search, you probably already know that WordPress replaces apostrophes and double quotes with prettier “curly” versions, like this:

"I'm in double quotes." → “I’m in curly quotes!”

It does this with the best of intentions, I’m sure, and I think the curly quotes look very nice, but I don’t want them anymore. And if you clicked on this page in your search results, it’s likely you want to remove them also, along with other “character entity reference” conversions, e.g. double dash (--) to em dash (—). (Or maybe you were searching for how to suppress “smart” quotes?)

It’s easy to change this behavior, and it doesn’t require a plugin. You just need to add a few lines to one of your theme files. Before we get into that, let’s ask:

Why not pretty formatting?

To prevent WordPress from mangling code samples. This is the most common complaint I’ve seen. You’ll still have other things to watch for, though, …

A Note About XHTML Validation of ‘Moving to Freedom’ Pages

I try to make standards-compliant web pages here at movingtofreedom.org. It appeals to my petty, detail-oriented side. The compiler in me loves it when W3C or xmllint or tidy reports a valid web page. A pass from xmllint or tidy, or the green “valid” result from W3C is like a pat on the head. Good boy!

Why do I use XHTML for this place? Because that’s what WordPress templates were using when I started this site in 2006. I’m sure that’s still the case today, although some searching tells me it doesn’t have to be that way. XHTML seemed like the thing to do three years ago and I was happy to learn about it and conform to the transitional XHTML doctype. I wasn’t so excited about the strict doctype, but figured that was a concern for another day.

(Tangentially, an obscure poem recently made me aware of standards upheaval on the horizon involving the death of XHTML 2 and the emergence of HTML 5. I was surprised — although …

WordPress XHTML Validator Plugin

WordPress is very good about supporting standards and producing valid markup, and at least when I started using it, it had a link in the standard theme to proclaim the validity of its pages and prove it to you by taking you to the W3C Markup Validation Service. A lot of people never pay this any attention and promptly produce a bunch of non-complying pages, all the while shamefully leaving the boastful link in the sidebar or footer of their site.

Being a retentive sort about many things, I’ve always worked to ensure my pages validate correctly, looking for the below highly satisfying message on each and every one of these posts that I strive mightily to create for you:

(Versus the alternative which is highlighted with red instead of green, and tells you that you are not just inadequate but are a bad person as well.)

But this can be a tedious chore. In order to validate by …

Code Format Helper for WordPress (Java Program)

Displaying code on a web page can be tricky, and even trickier if you use WordPress. You may have noticed in WordPress that straight quotes turn in to curly quotes, multiple dashes turn in to en dashes and em dashes, and so on. While this may make our posts look prettier, it does ugly things to code formatting.

(See my post from yesterday on HTML Character Entity References for a table of related characters and encodings.)

Hyphen prettification is one example of where you’ll get in to trouble when trying to show some code. Your decrement –i; may get converted to –i;, breaking your code and causing would-be users to hate you. Or String s = "oops"; will become String s = “oops”;, with similarly unhappy copy-and-paste results.

Using the <pre> tag will take care of most of these problems for you… sometimes. I’ll describe some ways that “pre” doesn’t wipe away all of our tears, and offer the WordPress Code Helper as a possible …

HTML Character Entity References of Potential Interest to WordPress Users

character ref #ref name
curly left single quote‘&#8216;&lsquo;
curly right single quote’&#8217;&rsquo;
curly left double quote“&#8220;&ldquo;
curly right double quote”&#8221;&rdquo;
en dash–&#8211;&ndash;
em dash—&#8212;&mdash;
ellipsis…&#8230;&hellip;
left angle quote«&#0171;&laquo;
right angle quote»&#0187;&raquo;
single quote (apostrophe)'&#0039;&apos;
double quote"&#0034;&quot;
hyphen-&#0045; 
backslash\&#0092; 
forward slash/&#0047; 
period (dot).&#0046; 
space &#0032; 
non-breaking space &#0160;&nbsp;
ampersand&&#0038;&amp;
less than<&#0060;&lt;
greater than>&#0062;&gt;

I was going to include this table as part of a longer, related entry, but then I thought it might be better posted as a stand-alone reference.

The first several items are things that WordPress will create for you to make your posts prettier. For example, WP will convert normal quotes into curly quotes and change three consecutive dots into an ellipsis. This is often desirable, but can also be a nuisance.

The »right angle quotation mark» are used …

Turning off trackbacks/pingbacks…

I don’t get a lot of legitimate trackbacks, but lately I’m getting an annoying amount of spambacks, so I’m turning them off for now. If you’re one of the few kind folks who occasionally point my way (I’m looking at you, Open Source Community) :-), please consider a “manual” ping in comments.

On the other hand, I’m getting almost no comment spam, which I credit to the Math Comment Spam Protection Plugin, previously mentioned in a post about my WordPress Plugin Binge last month.

Bad Behavior is another good tool and currently stops a couple of thousand access attempts per week. Akismet is super, but anything that it catches is something I then have to deal with. I’m not getting all that many spam trackbacks, but the ones I get are still a nuisance. (And several have slipped by Akismet.)

(I hear great things about Spam Karma, but so far I haven’t felt the need to …

YARQ! Quotes and Excerpts and Snippets, Oh My!

Updated, 11 July 2010: New YARQ post: WordPress Plugin, YARQ v3.0: Yet Another Random Quote. An updated and enhanced version compatible with WordPress 3.0. Includes the ability to edit quotes, among other cool things. Check it out!

I like quotes and excerpts. I’m not a big fan of the signature quote in emails and forums — it becomes repetitive to see the same pearls of wit and wisdom over and over and over again — but in general I like a good quote and have collected quite a few over the years.

(Skip ahead past techie background info to read about the exciting new MovingToFreedom.org site feature…)

I’d been thinking lately about adding some kind of random quote feature here, and this weekend after writing a couple of posts I needed something to prevent me from doing other pressing tasks, so I started toying around with the idea. I considered a custom PHP feature, and although it …