Apricot is a text-heavy and graphic-light, widget- and tag-supporting minimalist WordPress theme built on a Kubrick foundation. Apricot validates as XHTML 1.0 Strict and uses valid CSS. It natively supports the excellent Other Posts From Cat and the_excerpt Reloaded plugins, should you want to install them.

WordPress version 2.3 introduces native support for ‘tags’, a method of organizing posts according to key words. Apricot has been updated to use this native tag system. The tag cloud will appear in the sidebar and the tags for each post appear above the meta data.

I used Apricot on this site for over a year, making little tweaks and adjustments the whole time, so the theme is pretty thoroughly tested in a variety of different browsers and resolutions. While the markup is derived from the WordPress default theme, Kubrick, I’ve added a few modifications of my own. I’ve listed some of these changes below.

header.php

  • Title tag reconfigured to display “Page Title | Site Name”

single.php

  • Post title is now wrapped in H1 tags
  • Metadata shows when the post was last modified (if ever)
  • Added links to social bookmarking/blog indexing sites: Del.icio.us, Digg, Furl, Google Bookmarks, and Technorati
    I’ve published a fix for the Sociable plugin, which I’m now using instead of hard-coded links
  • If the Other Posts From Cat plugin is active, the theme will use it
  • Comments by the post’s author can be styled independently

page.php

  • Displays the page’s last modified date (instead of date of publication)

index.php

  • Displays the full text of the latest post and an excerpt from each of the next nine most recent posts
  • Native support for the_excerpt Reloaded plugin, if active

sidebar.php

  • Displays tag cloud, if tags are enabled

search.php

  • If no results found, displays the site’s most recent five posts

404.php

  • Displays the site’s most recent five posts

footer.php

  • Archive and index page titles + blog name wrapped in H1 tags

Screen shot

Apricot - A WordPress theme by Ardamis.com

Search engine optimization

Apricot takes care of most of the on-page factors that Google values highly. It places the post’s title at the beginning of the title tag and in a H1 tag near the top of the page. It is free of extraneous markup and the navigation is easily spiderable. It generates what I think is a pretty logical site structure from the various post and category pages, though I have yet to study the effect of the new tagging system.

I’ve had a few top-ranked pages with this and other structurally similar layouts. Your mileage with the search engines may vary, but the layout uses fundamentally sound structural markup, which should give your site a good start.

Download

Download the theme from http://wordpress.org/extend/themes/apricot or from the link below.

Download the Apricot WordPress Theme

What if I want to use an image as a header?

Lots of people would rather use a graphic as a header, including me, but the WordPress guys insist on each theme uploaded to http://wordpress.org/extend/themes/ display the blog title and tag line.

If you want to replace the blog title and tag line with an image, download this zip file and follow these instructions (also included in readme.txt).

1. Make a PNG image, name it “header.png” and upload it to the /wp-content/themes/apricot/images/ folder. It should be 800px wide by 130px tall, or less.

2. Replace the original Apricot theme’s header.php file with the header.php file from this folder.

Download the Apricot Image Header

I’m trying to think of a word that I’m not sure even exists. It describes the phenomenon of two occurrences—two blinking lights, two beeping sounds, etc.—that each happen at regular but different intervals. Because of the difference between these intervals, the two occurrences will seem to happen in unison, then gradually fall out of sync before again returning to a synchronous instance. For example, blinking light ‘A’ flashes every 9 seconds and light ‘B’ flashes every 10 seconds. At a certain point in time (in this case, every 90 seconds), both lights will flash simultaneously; but at the next flash, light ‘A’ will flash one second sooner than ‘B’. For 45 seconds, the amount of time between light ‘A’ and light ‘B’ will increase with each flash, until the flashes are substantially opposed—light ‘A’ will flash, 5 seconds later light ‘B’ will flash, and 4 seconds after that light ‘A’ will flash again. The flashes will then occur with successively diminishing amounts of time between them until they once again flash in unison.

You’ll see examples of this with those battery-powered yellow construction lights, lights on antennae or the spires of two different buildings (and sometimes the same building), two faucets dripping, the back-up-beeping noises of construction equipment, two people dribbling basketballs, etc. Any two things that happen regularly but at different periods will come in and out of sync.

It seems that there must be a word for something as common as this, but I’ve Googled all sorts of variations on this description without any satisfaction. The closest I can get is “phase synchronization”, which I’m not happy with. There is a rather interesting conversation on the subject at ask.metafilter.

I’d like to point out that I’m throwing terms around here that I don’t understand and probably aren’t correctly used, but it’s the best I can do with zero physics training.

Update 28 April 2009: Well, by total coincidence, here we are exactly two years later and still no closer to a word to describe this phenomenon. I’ve put together a little example with JavaScript that uses two flashing boxes to illustrate this behavior. I’ve timed it so the thing starts syncronized, goes out of sync, and then returns to sync every 11 seconds, which I think demonstrates it pretty well.

 

start

Click the start button to begin the boxes flashing at slightly different intervals.

The left box changes to grey for .5 seconds, changes to white for .5 seconds, and then changes back to grey.

The right box changes to grey for .5 seconds, changes to white for .6 seconds, and then changes back to grey.

This extra .1 second of white on the right box makes the two boxes flash grey at different intervals.

Notice how they get increasingly out of sync until the flashing is perfectly opposed – when one is flashing grey, the other is flashing white. Then they gradually return to sync – flashing grey simultaneously one time before going out of sync again. The whole cycle repeats every 11 seconds.

Update 24 August 2009: I might be getting closer to actually finding the word(s). A friend suggested “recurring instances”, which sounds good, but doesn’t really communicate the going in and out of sync thing, in that the instances could recur simultaneously each time. The crux here is that the two repeating events are asynchronous.

Incidentally, xkcd has a comic on the subject, titled Turn Signals. It is referred to in the comic as beat frequency, which is a term typically used to describe audible phenomenon. I found a few informative pages describing Beat Frequencies in Sound and Beat Frequency of Sound Waves that also have some audio examples, which closely match what I’m trying identify.

But beat frequency still isn’t exactly it, to my mind. It’s just the audible-only equivalent of it.

Update 17 May 2011: Harmonic oscillation, which is usually visualized by a spring with a mass attached bouncing up and down, seems to be a close relative to what I’m looking for. A simple harmonic oscillator showing the simple harmonic motion of three undamped mass-spring systems is very similar to my flashing lights phenomenon. Each spring system has a period, which is the time it takes to start at one position, cycle through the motion, and return to the starting position. Systems with different periods will occasionally all be at their starting positions at the same time.

Update 1 July 2011: I think the word is polyrhythm. Polyrhythm is usually described in terms of music, but it certainly seems to apply here.

airlock

Yes, everyone knows what an airlock is, but I still really like the word.

catenary

Another favorite obscure word for a rather familiar phenomenon is “catenary“.

In mathematics, the catenary is the shape of a hanging flexible chain or cable when supported at its ends and acted upon by a uniform gravitational force (its own weight). The chain is steepest near the points of suspension because this part of the chain has the most weight pulling down on it. Toward the bottom, the slope of the chain decreases because the chain is supporting less weight.

The catenary is the ideal form for an arch which supports only itself. If made of individual elements whose contacting surfaces are perpendicular to the curve of the arch, no significant shear forces will be present at the joints, and the thrust into the ground will be directly along the line of the arch. The Gateway Arch in Saint Louis, Missouri, United States follows the form of an inverted catenary.
Wikipedia

Catenary curves are not to be confused with the arc formed by the cable of a suspension bridge; that is a parabolic curve.

Update 7/31/10: I no longer support this plugin and have removed it from the site. You can still download the code, if you like, but it needs to be updated before it will work correctly.

This plugin allows you to add an XHTML and CSS Halo 2 Stats sig to your WordPress blog, which you can then style to fit your layout. The plugin displays your emblem, your level in each of the ranked game types, and your overall rank, which is equal to the highest ranked gametype. If Bungie calculates this differently, I can’t tell. It also displays the total number of games played and the date and time of your last game. By default, the plugin uses the background from your profile page at Bungie.net: http://www.bungie.net/Account/Profile.aspx?player=ardamis. You can change this in your profile preferences.

It’s a pretty neat set up already, but the best part is that because it’s all XHTML and CSS, it is completely customizable. Change the font or the colors, move the elements around, even hide some of them, whatever, to suit your site. If you’re comfortable with PHP, you can even edit the plugin to display more or less information. I’ve written a brief explanation about how the plugin grabs the data in the post at Xbox 360 Gamercard WordPress Plugin.

Installation

The download includes:

  • halo2stats.php (put this in your /plugins/ directory)
  • halo2stats.css (copy and paste the contents into your theme’s style.css)

The plugin attempts to create a text file (halo2_cache_YOURTAG.txt) for use as a cache in your blog’s root folder automatically. Some server configurations may not permit the plugin to create this file and you’ll see resultant errors; in this case, you may have to manually create a file with that name and upload it to your blog’s root (and perhaps set permissions).

Usage

The plugin accepts two arguments: your gamertag and ‘nolinks’, a parameter to hide links to this page, the detailed game stats from Bungie.net, and the recent games RSS feed.

Insert the code:

<?php if (function_exists('ardamis_halo2')) ardamis_halo2('YOURTAG'); ?>

into a template file wherever you want the sig to appear, replacing YOURTAG with your actual Xbox Live gamertag, ex.:

<?php if (function_exists('ardamis_halo2')) ardamis_halo2('ardamis'); ?>

If you don’t want to display the various off-site links, add the ‘nolinks’ argument:

<?php if (function_exists('ardamis_halo2')) ardamis_halo2('YOURTAG',nolinks); ?>

Limitations

The data we are interested in is served as HTML, not RSS. Incorporating an RSS feed into a page is pretty simple. Bungie does offer an RSS feed of recent game stats, but the feed is missing some crucial player stats, such as overall rank, rank by game type, games played and won per game type, and percentage experience needed for the next rank. All of this information, except the overall ranking, is available on Bungie’s player stats page. I don’t need all of this data, but I would like to be able to see my overall ranking. Unfortunately (there always seems to be an unfortunately), the Bungie player stats page doesn’t always provide accurate and complete information (you’ll often see an incorrect “No Games Played” message in place of your rank for a specific game type), and each change Bungie makes to that page has the potential to break the plugin. This is because the regular expression matching method I use to extract it expects to see specific lines of HTML code in the page. Should the layout change, the plugin might not find what it’s looking for, and so the whole system is both unreliable and fragile. For example, the plugin would have broken when Bungie changed the site around to add a section for Halo 3 stats, and it broke when the stats were reset and the new maps added on May 10, 2007. I’ll try to maintain this thing and quickly update it if/when Bungie’s changes break it, but I’m making no promises about future performance or usability.

The plugin takes the ranking for each game type and then sorts through them to find the highest one. The highest individual game type ranking is displayed as the player’s overall ranking. If Bungie has a more sophisticated method of determining overall rank, I’m not aware of it. But because of the occasional “No Games Played” message, the overall ranking might be incorrect.

Download

Get the files here: (Current version: 1.4 beta)

Download the Halo 2 Stats WordPress Plugin

Can I get this as a WordPress Widget?

Honestly, the plugin is much more flexible than a widget. Widgets are limited to your sidebar, while the plugin can be used in any template. Furthermore, this thing is 420 pixels wide, is that going to fit in your sidebar? Maybe some day when I have nothing else coming down the pike I’ll modify my plugins to be used as widgets, but not today.

How can I add the stats to a post?

Thanks to a really neat plugin, The Execution of All Things, you can call functions from any activated plugin from within a post. Once you have both the Halo 2 stats plugin and the wp-exec plugin installed, you can include the sig in a post with the line:

<exec type="function" name="ardamis_halo2" params="YOURTAG" />

How can I add the stats to a non-WordPress site?

I’ve been asked a few times for a way to get the same functionality outside of WordPress. I’ve put together a PHP script that you can include from any page with the line:

<?php include 'FULL-PATH-TO-SCRIPT/halo2stats-standalone.php?h2tag=YOURTAG'; ?>

Obviously, you’ll replace ‘YOURTAG’ with your gamertag. If you have spaces in your gamertag, replace each space with %20.

Download the Halo 2 Stats Standalone Script

I’m getting an error message

If your server does not have cURL enabled, you’ll get an error message that reads something like Fatal error: Call to undefined function curl_init() in PATHwp-contentpluginshalo2stats.php on line 64. The best solution is to ask your host to recompile PHP with cURL. If that option is unavailable, I’ve provided an alternative plugin that uses the function file_get_contents(), but a number of hosts have disabled the URL retrieving capabilities in file_get_contents() for security reasons. Download the FGC Halo 2 Stats WordPress Plugin only if you are getting an error message with the regular download.

If you are trying to use the stand-alone script, but getting an error message similar to Warning: include(halo2stats-standalone.php?h2tag=YOURTAG) [function.include]: failed to open stream: Invalid argument in PATH, you are not using the full URL in the path to the stand-alone script. You must use the full URL in your include whenever you use variables in the URL. Otherwise, the server looks for a file named halo2stats-standalone.php?h2tag=YOURTAG instead of executing the file halo2stats-standalone.php with the variable ?h2tag=YOURTAG.

Update 2.9.11: Kevin Fell has taken up the challenge of maintaining this plugin. Please find the latest release that works with the post January 20, 2011 update at http://www.kevin-fell.co.uk/development/x-box-360-gamercard-wordpress-plugin/.
Update 1.24.11: I realize the January 20, 2011 update to the gamercard has broken the plugin. Basically, the plugin expects the HTML of the gamercard to be exactly so, and the HTML of the new card doesn’t match the plugin’s expectations. I don’t know if I’ll update the plugin to work with the new gamercard.

I’ve put together a WordPress plugin that will display a customizable XHTML and CSS Xbox 360 gamer card. There are plenty of sites out there that will make good looking gamer cards using image files, but this method will give you complete control over the appearance. It also acts like a gamer card, with a link to your Xbox Live profile and “compare to” links to your five most recently played games, something the image file cards can’t do.

XHTML and CSS Xbox Gamercard WordPress Plugin

XHTML and CSS Xbox Gamercard WordPress Plugin

For those of you who want a raw PHP script with the same functionality, I’ve included one farther down in the post.

How the plugin works

The plugin uses cURL, a command line tool for transferring files with URL syntax, to read the contents of your Xbox Live gamer card from http://gamercard.xbox.com/YOURTAG.card into a string, and then uses the PHP function preg_match to perform regular expression matching on that string. The various elements of your gamer card are extracted and then assigned to variables for later output.

The plugin attempts to create a unique text file for each gamertag (gamercard_cache_YOURTAG.txt) for use as a cache in your blog’s root folder automatically. This is done to reduce the number of times the target HTML page must be accessed and parsed and therefore reduce server load and page load time. Some server configurations may not permit the plugin to create this file and you’ll see resultant errors; in this case, you may have to upload a file with that name and perhaps set permissions on the file. You can edit the plugin to adjust how old the cache can grow before the script refreshes the information from gamercard.xbox.com.

Usage

The plugin accepts two arguments: the first is your gamertag; the second, which is optional, toggles whether the recently played games are displayed.

Insert the code:

<?php if (function_exists('gamercard')) gamercard('YOURTAG'); ?>

into a template file wherever you want the gamer card to appear, replacing YOURTAG with your actual Xbox Live gamertag, ex.:

<?php if (function_exists('gamercard')) gamercard('ardamis'); ?>

You can include multiple, different gamer cards on each page.

Customization

To show the recently played games icons, add the “full” argument, ex.:

<?php if (function_exists('gamercard')) gamercard('ardamis', full); ?>

Do whatever you want with the CSS to integrate the gamer card into your site.

Installation

The download includes:

  • xbox-gamercard.php (put this in your /plugins/ directory)
  • gamercard.css (copy and paste the contents into your theme’s style.css)
  • /gc_images/ (optional – put this folder of reputation images in your WordPress theme’s /images/ folder if you want to use them)

The plugin by default now uses the gold stars with transparent background from the ‘mini-card’ in the top navigation of http://www.xbox.com/. The rep image is a transparent .png, however. If you’re worried that people using IE6 will see an ugly rep because of IE6′s lack of support for transparent .png, you may want to edit the plugin to use a different rep image. It’s easy.

screen shot of mini-card from Xbox.com

a screen shot of the ‘mini-card’ from Xbox.com

The optional ‘gc_images’ folder contains 20 images, one for each reputation rank, to replace the default gamercard gauge. They are based on the gauge used in the smaller, menu bar gamercard on the old http://live.xbox.com/ site, but with transparent backgrounds instead of gray for greater flexibility. You don’t need to use these, of course. I’ve written 3 variables into the plugin if you want to use the official Xbox rep images. Just edit the plugin to replace $navgamerrep in the output with one of the other variables. (Seriously, it’s easy.)

Download (beta 1.3)

Get the files here:

Download the Xbox 360 Gamer Card WordPress Plugin

I’m getting an error message

If your server does not have cURL enabled, you’ll get an error message that reads something like Fatal error: Call to undefined function curl_init() in PATHwp-contentpluginsxbox-gamercard.php on line 54. The best solution is to ask your host to enable cURL. If that option is unavailable, I’ve provided an alternative that uses the function file_get_contents(), but a number of hosts have disabled the URL retrieving capabilities in file_get_contents() for security reasons. Download the FGC Gamer Card WordPress Plugin only if you’re getting an error message with the regular download.

Can I get this as a WordPress Widget?

Honestly, the plugin is much more flexible than a widget. Widgets are limited to your sidebar, while the plugin can be used in any template. Installing the plugin isn’t very complicated, either. So, in short, there are no plans to adapt this as a widget right now.

How can I use this on a non-WordPress site?

Download the Xbox 360 Gamer Card Stand-alone Script

Just PHP include the xbox-gamercard-standalone.php script wherever you want the card to be displayed, adjusting the path to the reputation images. Add the contents of gamercard.css to your main CSS file, and modify to suit your site.

Be aware that message boards and forums (eg: vBulletin forums) won’t allow you to use PHP as part of your post or signature. In short, don’t expect this method to work anywhere but on your own site.

You can either edit the script to use your gamertag, or call the script with the line:

<?php include 'PATH-TO-SCRIPT/xbox-gamercard-standalone.php?tag=YOURTAG'; ?>

To show the recent games, use:

<?php include 'PATH-TO-SCRIPT/xbox-gamercard-standalone.php?tag=YOURTAG&full=full'; ?>

Obviously, you’ll replace ‘YOURTAG’ with your gamertag. If you have any spaces in your gamertag, replace each space with %20.

Further customization (optional)

A number of neat image and Flash sigs contain way more information than just what’s provided at http://gamercard.xbox.com/YOURTAG.card, but as far as I can tell, it’s all gathered in the same way. If there’s something you’d like added to the script, find a page that contains the information and post a comment about it, or give programming a shot yourself…

View the source code of the target page and locate the data you wish to extract. What we want to do is identify everything but the desired data. Isolate the desired data within the source code of the target page by copying everything from the first character before the data back to and including something unique, such as a div’s id. Paste that into a preg_match line as the first half of the pattern that the script will look for. Follow that with the characters (.+?), a bit of code that represents the data we want to extract. Do not copy the actual desired data from the target page into the modified script. Last, select and copy a few characters immediately after the data, such as the closing div, and paste that after the (.+?). Everything in between the two copied strings—the stuff now represented by the (.+?) characters—will be assigned to a variable.

Credits

Thanks to Constantin Hofstetter for getting me started on this project and to Jeremy at 360gamerCards.com for eliminating the need for the Snoopy script, reducing the process to a single file and otherwise greatly simplifying the whole thing. And thanks to everyone who emailed or posted with error messages and other problems; it’s a better, more robust plugin because of your efforts.

My gamertag is ardamis, should you want to add me to your friends list and give me some positive feedback.

I’ve happened across an apparent bug in the way Internet Explorer renders the Mootools Accordion javascript when inside a table. Specifically, I’m trying to use the Accordion to show and hide a new table row. I’ve put the stretcher div inside a td cell, which opens and closes correctly in Firefox, but exhibits two distinct problems in IE 6 and 7. For one, the action should be smooth, but is bouncy and jerky. For another, after the div collapses, it springs open a few pixels and remains that way, impacting the consistency of the table layout.

If anyone has any suggestions on how to correct this buggy behavior, I’d be much obliged.

I’m stoked. Emails for the second round of Halo 3 beta invitations were sent today and somehow I made it in. I was pretty pissed when I woke up late on the 5th and found the server at http://halo3.com/ clogged with people trying to get in. I mashed F5 for about 8 minutes anyway and filled out the little form, but had already given up hope. I’ll see you guys this spring.

Here’s the gist of the email:

Halo 3 Beta

Congratulations ardamis,

You were one of the first 13,333 gamers to meet the “Rule of Three” program eligibility requirements. As a result, you have been selected to participate in the Halo® 3 beta.

In order to participate, you must have access to:

  • An Xbox 360™ Pro console or Xbox 360 Core console with hard drive
  • A valid Xbox Live® Gold subscription

Keep an eye on your inbox, we will be sending more information about this opportunity soon.

I’ve written a Plogger beta 3 stand alone theme that takes visual cues from the Yahoo! Mail beta of early 2007. It is pretty monochromatic, vaguely earthy, with some soft gradients and rounded edges. It is fully XHTML 1.0 Strict valid (and I’m hoping that Plogger’s core files’ output will be valid when version 3 is released). It looks nearly identical in Firefox 2.0 and Internet Explorer 7, and uses conditional CSS to be very similar in IE6.

Plogger beta 3 theme: Softer screenshot

The fundamental changes are:

  • The theme template files are now primarily HTML with some PHP, rather than being entirely written in PHP. This will make it easier for people with basic knowledge of HTML to further customize the theme.
  • The compatibility with Internet Explorer 7 has been greatly improved. Among other things, a new float and clear bug in IE 7 has been avoided. The theme is inherently much more stable and less prone to breaking in different browsers.

I’m working on the following non-critical problems:

  • Figure out a satisfactory method for generating <title> tags in index.php.
  • Improve the breadcrumb on the picture view pages to use the picture’s title instead of the file name, if the former exists.

Note that this download is only for use with Plogger beta 3.

Download the latest version of the Plogger beta 3 Softer theme here:

Download the “Softer” Plogger beta 3 theme

Other themes

I’ve also written the following themes:

I’m in the process of writing a new theme for Plogger beta 3, called “Diffuser”. It uses the Lucid theme as a foundation, but will validate as XHTML 1.0 Strict (with some editing of the core files; edited files are included). I’m a stickler for cross-browser compatibility, and this theme looks nearly identical in Firefox and IE7.

Plogger beta 3 theme: Diffuser screenshot

The fundamental changes are:

  • The theme template files are now primarily HTML with some PHP, rather than being entirely written in PHP. This will make it easier for people with basic knowledge of HTML to further customize the theme.
  • The width of the list item tag that holds each thumbnail is generated dynamically. The <li> tag is always 8px wider than the thumbnail image. This contributes to the correction of the issue with the Lucid theme under some browsers, wherein the list item’s width would be pushed out by long image captions.
  • The compatibility with Internet Explorer 7 has been greatly improved. Among other things, a new float and clear bug in IE 7 has been avoided. The theme is inherently much more stable and less prone to breaking in different browsers.
  • The unencoded ampersand error has been fixed to allow W3C validation as XHTML 1.0 Strict. These changes are made in ‘plog-functions.php’, which is included in the download.

I’m working on the following non-critical problems:

  • Figure out a satisfactory method for generating <title> tags in index.php.
  • Improve the breadcrumb on the picture view pages to use the picture’s title instead of the file name, if the former exists.

The download also contains a text file that gives a detailed explanation of the changes to ‘plog-functions.php’. Note that this download is only for use with Plogger beta 3.

Download the latest version of the Plogger beta 3 Diffuser theme here:

Download the “Diffuser” Plogger beta 3 theme

Looking for something more refined?

I’ve also written a more refined theme, the Plogger beta 3 theme: Softer. It uses some rounded edges and soft gradients, and includes the “sort by” function.

I was tired of seeing the majority of my posts’ comments feeds show up in Google’s Supplemental Index, so I changed all the individual posts’ comments RSS links to rel=”nofollow”. This should at least cause Googlebot to stop passing PageRank through those links, but what I really want is for Googlebot to stop spidering the individual posts’ comment feeds, in hopes that they’ll eventually be removed from the index. To see only those pages of a site that are in the Supplemental Index, use this neat little search feature: site:DOMAIN.com *** -view. For example, to see which pages of Ardamis.com are in the SI, I’d search for: site:ardamis.com *** -view. This is much easier than the old way of scanning all of the indexed pages and picking them out by hand.

To change all the individual posts’ comments feed links to rel=”nofollow”, open ‘wp-includesfeed-functions.php’ and add rel=”nofollow” to line 84 (in WordPress version 2.0.6), as so:

echo "<a href="$url" rel="nofollow">$link_text</a>";

One could use the robots.txt file to disallow Googlebot from all /feed/ directories, but this would also restrict it from the general site’s feed and the all-inclusive /comments/feed/, and I’d like the both of these feeds to continue to be spidered. Another, minor consequence of using robots.txt to restrict Googlebot is that Google Sitemaps will warn you of “URLs restricted by robots.txt”.

To deny all spiders from any /feed/ directory, add the following to your robots.txt file:

User-agent:*
Disallow: /feed/

To deny just Googlebot from any /feed/ directory, use:

User-agent: Googlebot
Disallow: /feed/

For whatever reason, the whole-site comments feed at http://www.ardamis.com/comments/feed/ does not appear among my indexed pages, while the nearly empty individual post feeds are indexed. Also, the general site feed at http://www.ardamis.com/feed/ is in the Supplemental Index. It’s a mystery to me why.

I’ll occasionally return to a post and revise it for improved methodology, test results or whatever. But the ‘posted on’ date always remains the same, even after the post has been updated. I feel that displaying only the ‘posted on’ date could be somewhat confusing, particularly when I state that I’ve updated the post in a comment dated months later. So, in the interest of full disclosure, I have added a few lines of code to the WordPress ‘single.php’ template file to supplement each post’s meta data with the date it was last modified. If the post has never been modified or if it was last modified within 24 hours of the ‘posted on’ date, only the ‘posted on’ date is shown.

Of course, this could be used anywhere inside the WordPress loop, not just in the meta data section. The code I use to show a WordPress post’s last modified date and time is as follows.

The default Kubrick template’s meta data section:

<p class="postmetadata alt">
<small>
This entry was posted 
...
on <?php the_time('l, F jS, Y') ?> 
at <?php the_time() ?>
and is filed under <?php the_category(', ') ?>.
You can follow any responses to 
this entry through the 
<?php comments_rss_link('RSS 2.0'); ?> feed. 

The new code, modified to selectively display the last modified date:

<p class="postmetadata alt">
<small>
This entry was posted
...
on <?php the_time('F jS, Y') ?> 
at <?php the_time() ?>
						
<?php $u_time = get_the_time('U'); 
$u_modified_time = get_the_modified_time('U'); 
if ($u_modified_time >= $u_time + 86400) { 
echo "and last modified on "; 
the_modified_time('F jS, Y'); 
echo " at "; 
the_modified_time(); 
echo ", "; } ?>
	
and is filed under <?php the_category(', ') ?>.
You can follow any responses to 
this entry through the 
<?php comments_rss_link('RSS 2.0'); ?> feed. 

You can see how this works in the meta data section of this post.

Further customization

I’m using a grace period of 24 hours from the time the post was published, but you could change this by replacing 86400 with however much time you want, specified in seconds.