New book on WordPress Theme Development: WordPress Themes In Depth
2008 Apr
Monthly Archive

Universal www-Canonicalization via htaccess

During my previous rendezvous involving comprehensive canonicalization for WordPress, I offer my personally customized technique for ensuring consistently precise and accurate URL delivery. That particular method targets WordPress exclusively (although the logic could be manipulated for general use), and requires a bit of editing to adapt the code to each particular configuration. In this follow-up tutorial, I present a basic www-canonicalization technique that accomplishes the following: requires or removes the www prefix for all URLs absolutely no editing when requiring the www prefix minimal amount of editing when removing the www prefix minimal amount of code used to execute either […] Read more »

Toggle Element Visibility via JavaScript

Recently, while restoring the popular Jupiter! WordPress theme, which several readers use to “skin” the Perishable Press website, I found myself searching for a simple, effective JavaScript technique for toggling element visibility. Specifically, I needed to accomplish the following design goals: Users should be able to toggle the visibility of any division containing post-meta information The post-meta information should remain visible by default and when JavaScript is unavailable The JavaScript should be as unobtrusive as possible, requiring minimal scripting in the markup Here are a couple of screenshots demonstrating this repetitious toggling functionality as employed in the Jupiter! theme (click […] Read more »

Blacklist Candidate Number 2008-04-27

Welcome to the Perishable Press “Blacklist Candidate” series. In this post, we continue our new tradition of exposing, humiliating and banishing spammers, crackers and other worthless scumbags.. Since the implementation of my 2G Blacklist, I have enjoyed a significant decrease in the overall number and variety of site attacks. In fact, I had to time-travel back to March 1st just to find a candidate worthy of this month’s blacklist spotlight. I felt like Rod Roddy looking over the Price-is-Right audience to announce the next name only to discover a quiet, empty room. And then like Bob gets pissed that nobody […] Read more »

Top Ten Pink Floyd Songs for Audiophiles

The music of Pink Floyd is an audiophile’s wet dream. It is at once diverse, complex, intricate, rhythmic, mysterious, and downright heavy. The vastly inspiring soundscapes created by Pink Floyd are perfect for late nights spent working on the computer. Given a nice pair of high-quality headphones, the following hand-picked collection of Pink Floyd songs is sure to elevate your listening experience to the next level. Read more »

Obsessive CSS Code Formatting: Opening and Closing Brackets

Following my recent post on CSS code formatting, I was delightfully surprised to have received such insightful, enthusiastic feedback. Apparently, I am not the only person passionate about the subtle nuances involved with the formatting of CSS code. So, to continue the conversation, let’s explore several techniques for writing the opening and closing brackets of CSS declaration blocks. Read more »

How to Block Proxy Servers via htaccess

Not too long ago, a reader going by the name of bjarbj78 asked about how to block proxy servers from accessing her website. Apparently, bjarbj78 had taken the time to compile a proxy blacklist of over 9,000 domains, only to discover afterwards that the formulated htaccess blacklisting strategy didn’t work as expected: deny from proxydomain.com proxydomain2.com Blacklisting proxy servers by blocking individual domains seems like a futile exercise. Although there are a good number of reliable, consistent proxy domains that could be blocked directly, the vast majority of such sites are constantly changing. It would take a team of professionals […] Read more »

The Pros and Cons of Blogging

Among my friends, family, coworkers, and other social acquaintances, there are not many “bloggers.” In fact, there aren’t any. Two or three of my old friends have websites that are updated once or twice per year, but none are actively blogging and sharing their ideas with the online community. Many of my “non-blogging” peeps simply don’t “get it.” To them, the whole idea of consistently updating a website with new material seems like a big waste of time. In fact, on several occasions, I have been confronted with some serious questions and criticisms about the whole “blogging thing.” In this […] Read more »

Drop-Dead Easy Random Images via PHP

Recently, while restoring my collection of Perishable Press themes, I needed a fast, effective way to randomize a series of images. After playing around with several likely candidates, I finally devised the following drop-dead easy technique: <img src=”http://domain.tld/path/random/image_<?php $random = rand(1,n); echo $random; ?/>.png” alt=”[ Random Image ]” height=”50″ width=”50″ /> This single line of code facilitates the random display of n number of images (image_1.png, image_2.png, image_3.png, etc.) located in the target directory (http://domain.tld/path/random/). For those of you that understand how this works, great! That’s pretty much the entire purpose of this article. However, for those that would appreciate […] Read more »

Pure CSS: Better Image Preloading without JavaScript

After reading my previous article on preloading images without JavaScript 1, Nanda pointed out that adding extra markup to preload images is not the best approach, especially where Web Standards are concerned. Mobile devices, for example, may experience problems when dealing with the following preloading technique: /* ADD THIS TO CSS */ div#preloaded-images { position: absolute; overflow: hidden; left: -9999px; top: -9999px; height: 1px; width: 1px; } <!– ADD THIS TO XHTML –> <div id=”preloaded-images”> <img src=”http://perishablepress.com/image-01.png” width=”1″ height=”1″ alt=”Image 01″ /> <img src=”http://perishablepress.com/image-02.png” width=”1″ height=”1″ alt=”Image 02″ /> <img src=”http://perishablepress.com/image-03.png” width=”1″ height=”1″ alt=”Image 03″ /> </div> Thus, as Nanda suggests, […] Read more »

How to Edit the Firefox Custom Dictionary

Oooops! Didn’t really mean to add that particular word to the Firefox custom dictionary. Better remove it now before it causes problems later on.. As one who takes full advantage of the custom dictionary in Firefox, I occasionally find myself adding nonexistent or misspelled words to the dictionary by accident. Not wanting to deal with a false negative down the road, I always take the time to stop what I’m doing, locate the custom dictionary, and remove the erroneous term. Finally getting sick of trying to remember the esoteric location in which Firefox stores the personal dictionary, I decided to […] Read more »

Perishable Press Gets Naked

In celebration of CSS Naked Day, Perishable Press has disabled it’s CSS stylesheet for today, April 9th, 2008 (which also happens to be my 36th birthday)! What are you waiting for? Go get naked!! ;) Read more »

Perishable Press Comment Policy

Before you comment here at Perishable Press, please take a moment to review the official comment policy. Here is a simplified overview of the complete policy: Comments are open to everyone. Name and email are required. Email kept private, never shared. Website URL optional. The form accepts basic XHTML. Line and paragraph breaks automatic. Please wrap each segment or line of code in tags (no <pre></pre> tags). I reserve the right to edit/delete any comment. Spam will be deleted. Pointless and otherwise lame comments may be deleted. Please stay on topic and comment intelligently. Official Comment Policy First, everyone has […] Read more »

Three Unsolved WordPress Mysteries

After several years of using WordPress, I have at least three unanswered questions: What’s up with the WordPress PHP Memory Error? Why do certain phrases trigger “Forbidden” errors when saving or publishing posts? What happened to the Plugin Pages in the WordPress Codex? Let’s have a look at each one of these baffling mysteries.. Read more »

Obsessive CSS Code Formatting: Patterns and Trends

Call me strange, but I format each of my CSS rules according to the following pattern: div#example element { margin: 5px 15px 5px 0; border: 1px solid #444; line-height: 1.5em; text-align: center; background: #222; font-size: 10px; display: block; padding: 5px; color: #888; float: left; } div#another div.example element { border: 1px solid #444; margin: 7px 0 17px 0; letter-spacing: 1px; font-weight: bold; background: #222; font-size: 1.1em; cursor: pointer; display: block; padding: 3px; width: 308px; color: #888; clear: left; float: left; } div#another div.example element { text-indent: -9999px; overflow: hidden; position: fixed; display: block; z-index: 9999; padding: 0px; margin: 0px; bottom: […] Read more »

Latest Tweets New PDF Demo of WordPress Themes In Depth: wp-tao.com/WordPress-Themes-In…