Recently I've incorporated several new features into the Straight to the Bar site, some of which are listed below. Also noted are a couple of older features that seem to generate a few questions.
Icon beside header line in Workout entries
This little guy performing a deadlift only appears when the post is a workout (as does the kg/lbs line in the individual archives). Both of these features are achieved using the Compare plugin, and the template code :
and
Add to digg, del.icio.us etc
The code for this is actually quite simple (although it took a while to track down) :
Pandora
Having recently re-discovered the brilliance that is Pandora, I decided to add a few stations to the sidebar (for those of you curious as to the type of music I train to). It really just depends on mood.
The code for adding a station list to a site, as well as a few other novel uses for Pandora, can be found here.
Fitness and Strongman links
These are now dynamically created, based on the information in the flinks and slinks categories. A separate template has been created for each.
Last Comment
These are now noted on the Individual Archive pages as :
Also changed in the comments handling is the way my own responses are displayed. These are now clearly differentiated from the rest of the discussion. For more info on this (including how to do it in Movable Type) see this article on Learning Movable Type.
Restriction of entries on the front page
Previously, entries from any category would appear on the front page. In some cases it meant that items I'd prefer to remain hidden (at least from that page) would appear - such as the feedback and thank-you pages.
To get around this, I've altered the code in my Main Index template :
This will display entries from any of the categories workouts, Diet and Nutrition,News, General, reviews, exercises, routines or Articles.
Latest Entries
Near the bottom of the sidebar is a Latest section, which displays the most recent posts (in the abovelisted categories) to appear on this site. The code is :
Archives in sidebar
Two major changes here. The first is a - when applicable - look at what was happening exactly one year ago. If there were no posts on that day, nothing appears. This information is extracted using the OnThisDay plugin.
This is integrated as follows :
The second is the appearance of two dropdowns, which offer quick access to both the complete category listing and monthly archive listing for this site. These are generated using a combination of MT, PHP and Javascript; with code courtesy Brad Choate - see his site for more information.
Header Images
These change with each page reload, using Hivelogic's Image Rotator script. The full sized images can be seen here. I first became aware of this script via this article on A List Apart (just after having written my own - tried and tested ultimately won out).
NB : code used in the above samples was automatically cleaned up (for display) using Dan Cederholm's SimpleCode.