Perishable

Designer, developer, author, artist. Projects: Perishable Press, Editor at Smashing Mag, Tao of WP, Digging into WP, .htaccess made easy, WP-Mix, xyCSS, & more.
Jun 27
Permalink

The Tao of WordPress

As an independent publisher, it’s not easy to compete with the giant chains and commercial big-budget names, so I try to get creative and post about my work wherever it makes sense to do so. And my Tumblr account certainly qualifies for this, so without further ado..

I’m stoked to announce my 3rd book, The Tao of WordPress, which is a complete guide for beginners, students, admins, and basically anyone who uses WordPress and wants to learn how to get the most from it. The book starts at the beginning with choosing the right software, hosting, and domain, and then proceeds through installation, configuration, and customization. The book also includes chapters on Plugins, Themes, Security, SEO, and optimizing performance. There’s also a meaty chapter packed full of sweet WP techniques, plus a starter template theme that’s used in examples throughout the book.

The Tao of WordPress is basically the sum of my 8+ years working with WordPress all boiled down and streamlined into a beautiful, simplified guide that focuses on exactly what you need to know to build awesome sites and succeed on the Web.

Check it out and get the book @ http://wp-tao.com/

Feb 02
Permalink

Office painted a warmish/neutral off-white color. New 2.1 Altec/Lansing speakers for crisp, clear sound. Two new executive desks: one for computer biz and another workspace for drawing, painting, and other offline pursuits. And of course, a big, cushy black office chair to make it all sweet.

Jan 19
Permalink

Quick Photoshop Reset

Very good Photoshop trick to know: If you hold down ALT+CTRL+SHIFT (Mac: CMD+OPT+SHIFT) while starting Photoshop you can reset all settings back to factory default. Very useful if you have problems with some tools or the interface. – http://bit.ly/4A5LJ5

Nov 01
Permalink

Insane October

By far the most insane month of 2009, October included the following activities:

1st week: Trip to the East Coast, beginning with some business in Connecticut.

2nd week: East Coast trip continues with much pleasure in downtown Manhattan.

3rd week: Photo and art excursions with good friend visiting from Portland, OR.

4th week: Marathon book-editing and fine-tuning for Digging into WordPress.

Now that November is here, things remain busy, but I am hoping to get a chance to restore some balance and regain my equilibrium. Of course, the holidays are right around the corner..

Sep 07
Permalink

Import Feeds to Facebook

Seems like a lot of misinformation and confusion out there on how to import and display your feeds on Facebook. Here is what worked for me:

1. In the lower left-hand corner of your Facebook account, click on “Applications” > “Notes”.

2. In the upper mid-right column, click on “Import a blog” in the “Notes Settings” panel.

3. In the “Import an External Blog” panel, enter your feed URL and check the little box.

4. Click the “Start importing” button and then click on “Confirm Import” on the preview page.

That’s all there is to it. Don’t forget to edit your “Notes Privacy” settings to ensure that people can see and comment on your imported feed items.

Once you successfully import your feed(s), they will appear by clicking on the “Notes” button in the left sidebar of your Home page. Also, your timeline or “Wall” will also display the most recent post from each of your feeds as they are published and pulled into Facebook. This makes it easy for your “Friends” to see what you have been up to elsewhere on the Web.

Aug 31
Permalink

help me in plain english

This has got to be the most ironic comment I have ever read:

"hi i dun a stupid noooby mistake and dint think about encrytion i just put a pass in the change pass box and now when i attempt to see my main.php or index.php its sayin password no and error how can i reset back to having no password or were can i edit the bit so that a pass is automattically seen or if not posable how can i make it so i can put in the pass i made at some point so i can login this way? the 3rd is most prefered as this will help me with other projects i am planning as i am a php noob :s plz sum1 hu is clever help me in plain english"

Thanks, “jay” — you made my week with that one.

Aug 04
Permalink

Redirection After Registration

After searching high and low for an unobtrusive method of redirecting users to a custom URL after registering at a WordPress-powered site, I finally resorted to (gasp) hacking the core. I simply could not find a better way of doing it that didn’t require a ton of additional code. I found several ways of redirecting users to various URLs after logging in and out, but absolutely nothing seems to exist on redirecting users to, say, the home page, or better yet, back to the current page after registering as a subscriber (or whatever role the Admin has set for new registrations). Indeed, the only way to direct a user to some page other than the default WordPress “Registration complete. Please check your e-mail.” screen (which looks just like the WP Login page, btw) is to hack the wp-login.php file.

Thus, for the sake of remembering this technique, helping others, and/or “inspiring” someone to find a solution, here’s how to hack WordPress to change the page that users are directed to after they register (via submission of a username and email address). First, open the wp-login.php file and find the line that says, “wp_redirect('wp-login.php?checkemail=registered');”. That’s the key right there. To change the location, replace the part that says, “wp-login.php?checkemail=registered” with the URL to which you would like to direct the newly registered users. You may use full URLs or even relative paths to a specific file. That’s all there is to it. It’s still hacking the core, but not by much ;)

Remember, if you’re going to hack the core, make a note of the change(s) and refer to it before/after each subsequent upgrade.

Jul 09
Permalink

A 500KB wp_options Table is Too Much

After my server crashed, I found myself restoring my site’s WordPress database. While there, I decided to dig around a bit and make sure everything was up to snuff. While looking through the wp_options table, I was surprised to discover that WordPress seems to cache around 400KB of “Planet WordPress” dashboard feeds (among other things). That’s a little extreme if you ask me, so I decided to clean things up and reduce my overall database size by around half a megabyte. Here’s how I did it using my archaic 2.3 version of WordPress and phpMyAdmin.

Step One: Take Some Notes

Before doing anything, copy and paste a few text snippets from your dashboard feeds. This will enable you to easily locate the oversize options fields for removal in Step Three. Note: permalinks from the various feed entries make for good search candidates.

Step Two: Kill the Feed

Place this in your theme’s functions.php file (props to Michael Shadle for the code):

function remove_dashboard_feeds() {
remove_action(‘admin_head’, ‘index_js’);
}
add_action(‘admin_head’, ‘remove_dashboard_feeds’, 1);

Step Three: Clean up Your wp_options Table

Once that is done, you may clean up your database by doing a quick search for some of the text snippets (permalinks work great) that you copied from the dashboard feeds in Step One. The field(s) that you find should be named something like “rss_123abc…”, where the “123abc…” is some long, apparently random alphanumeric string. Once you have disabled the feed via functions.php, feel free to reduce the size of your database by deleting the field(s) used to store data for the dashboard feed.

Doing this saved me an extra ~400KB of space, which is much-needed as the size of my Perishable Press database continues to grow.

May 30
Permalink

Stop Errors when Running Multiple Themes

Another quick WordPress tip for anyone running multiple themes in WordPress. If your site provides users the option of selecting from a number of different themes, you may have noticed errors like this in your PHP error log:

[28-May-2009 05:46:50] PHP Warning: main(): Failed opening ‘/…/press/wp-content/themes/requiem/searchform.php’ for inclusion (include_path=’/usr/lib/php:.:/usr/php4/lib/php:/usr/local/php4/lib/php’) in /…/press/wp-content/themes/default/sidebar.php on line 6

[28-May-2009 05:49:02] PHP Warning: main(/…/press/wp-content/themes/requiem/searchform.php): failed to open stream: No such file or directory in /…/press/wp-content/themes/default/sidebar.php on line 6

These errors happen when a user loads a page using a non-default theme that calls the searchform.php file via the following code:

<?php include (TEMPLATEPATH . ‘/searchform.php’); ?>

Since the template path is based on the default theme, this code will attempt to locate searchform.php in the default theme’s directory. Thus, non-default themes that contain this code will produce the PHP errors shown above.

Fortunately, eliminating this problem is as easy as replacing the “TEMPLATEPATH” with the actual path to the file in your theme. Something like this:

<?php include (‘/…/press/wp-content/themes/default/searchform.php’); ?>

..where the “…” (ellipses) represents something like, “home/public/domain” or similar, depending on your setup. This path must be the absolute path to work properly. Repeat this process as necessary for any other instances of “TEMPLATEPATH”.

That’s all there is to it — no more pesky PHP errors for missing template files! :)

May 27
Permalink

Maximum Characters for Google Meta Tags

I was going to post this on Twitter, but the service was down or otherwise not responsive (as it frequently is), so I decided to post the information here at Tumblr instead.

After trying to determine the maximum number of characters allowed for meta title, keywords, and description tags, I realized that the answers are not always clear, even where Google is concerned. One SEO site says one thing, someone in the Google forums says another. Bloggers and designers all seem to have their own opinions.

Fortunately, many of the proclaimed answers I encountered all seem to converge on a common set of values for the three meta tags. Here are my findings:

meta title tag: Perhaps the most widely agreed upon max-character value of the bunch, 60 characters (including spaces) seems to be the common denominator for the all-important title tag. Of course, you can make your titles as long as you want, but keep in mind that Google will only display the first 60 characters.

meta description tag: Lots of disagreement on this one, with some “experts” claiming a 160-character maximum (including spaces) and others saying that the value is more like 150. The range of values for the description tag ranged from over 200 to around 150, with 160 being a very common value. Thus, to be on the safe side, I recommend meta description tags of no more than 150 characters.

meta keywords tag: How many keywords can you stuff into the meta keywords tag? Well, that all depends on how many characters each of them contains. Lots of disagreement on this one, with lots of folks pointing out the utter foolishness of even bothering with meta keywords. Oh well, I still use them, and have determined that 800 (including spaces) seems to be a safe number of maximum characters for the meta keywords tag.

Of course, I am only blogging this info for my own future use, but I like to think of myself as a reliable source of information, so perhaps these max-character values will be useful to you as well. If you would like to chime in on the topic, please do so via Twitter. Any previous comments may be seen by clicking here.

May 19
Permalink

WordPress Theme Development Tip

Working with the Theme Switcher plugin is an excellent way to develop themes behind the scenes using WordPress. Simply install the Theme Switcher plugin, upload your working theme template files, and enter the secret URL (something like, “http://domain.tld/index.php?wptheme=Perishable”, where “Perishable” is the theme name) to activate the new theme. Easy as pie.

So that’s the scenario, and I’m sure that many of you are familiar with it. I have been using this method for years with nary an issue. Until today. Uploading a new theme that I am working on for Perishable Press, I began with the two required files: “style.css” and “index.php”. I then added a header and footer file and began fleshing things out with some basic functionality and markup. So far so good.

Then, after getting the header.php, index.php, and style.css files properly configured, I uploaded the batch fresh and went to check on the scene in Firefox. Uh-oh, not good. The header and CSS were loading fine, but the index.php file was not being loaded. Instead of the index file that I had created, WordPress was delivering up the default theme’s index.php file. No matter what I tried — clearing the cache, logging in/out of admin, deleting and re-uploading files, swapping out template code, and everything else I could think of — I just couldn’t get the new theme’s index.php file to load.

Fortunately, persistence pays off. After taking a quick break, I came back to realize that I had yet to add any code to the footer.php file. Aha! That was it. For some reason, if WordPress detects a blank footer.php file, it will assume that something is wrong and serve the index.php, footer.php, and other missing files from the default theme. And, I haven’t tested this, but I assume that WordPress does this when any non-required template files are blank (e.g., sidebar.php, search.php, category.php, et al).

In any case, after slapping a few lines of code into the blank footer.php file, everything began loading as expected — the new index.php appeared and that hideous default index.php finally went bye-bye.