Broken Link Contest

Help me clean up this mess — and maybe win a prize.

I’ve been building content on this site since 2003. In eight years, I’ve collected a lot of junk.

Broken Link ImageAs I revise this site, I’m going through every single post, deleting the ones I don’t think are relevant anymore, and fixing up the ones that remain. Along the way, I hope to hunt down and destroy all broken links.

But I’m only one person and can only check so many links in a day. So I’m asking for your help. And I’m willing to reward the folks who help me most with a free copy of any one of my books still in print.

Here’s how you can enter to win:

  1. Browse the site as you normally would.
  2. When you find a broken link*, open the comment for this post. (I put a link to it in the sidebar so it’s easy to find.)
  3. Check all the preceding comments to make sure your broken link isn’t already listed. I can’t give points for duplicate entries!

  4. If the broken link isn’t already listed, use the Comments form at the bottom of the page to enter the following information:
    • Your name and email address. (This might not be necessary if you’ve already commented here.) Please use your real email address; I will use it to contact you if you’re a winner. I will not share your address with anyone else or spam you. I promise.
    • The URL of the page where you found the broken link. It must begin with http://www.mariaguides.com/ — I’m not interested in rewarding folks for finding broken links on other sites.
    • The URL of the broken link. The easiest way to get this information is to either Control-Click (Mac OS) or Right-Click (Mac OS or Windows) on the broken link and use the Copy Link Location command in the contextual menu that appears. You can then paste it into the comment form.
  5. Submit the comment.
  6. Repeat as necessary. The more broken links you report, the better your chances of winning.

When I approve the comments — all comments are moderated here — I’ll check your findings. If you’ve correctly identified a broken link, you’ll score a point and I’ll note that in a reply to your comment.

At November month-end, I’ll award prizes to the top broken link finders.

Does this sound like a plan? I hope so. l could really use the help.


* A “broken link” is a link on a Web page that, when clicked, displays a “Page Not Found” error or something similar. In other words, it doesn’t display what it should for whatever reason.

Category Feeds Being Removed

As part of the site revision process, I’ve decided to do away with the category-specific feeds. These feeds, which cover Excel, Mac OS, Word, and WordPress content, are being utilized by less than 100 people. If you’re reading this message in your feed reader, YOU might be one of them.

Within a month or so, these feeds will simply not work. Delete them from your reader.

If you want to continue receiving content from this site via RSS, please subscribe to the main feed, using one of the following URLs:

Major Site Update Planned

I am embarrassed about this mess and will start fixing it today.

It boggles my mind how bad I’ve let this site become. Cluttered, tiny print, bad links, missing files, out-of-date content. And what’s with the missing spaces after certain punctuation? I typed them there — why don’t they appear?

Why do you let me get away with this?

Well, help is on the way. I begin reconstructive surgery on this site this afternoon. Not only will I be changing it’s entire look and interface, but I’ll be removing a lot of very old material and all the bad links that frustrate visitors to no end.

I expect the changes to take about a week to finish, so hang on and bear with me. Feedback is always welcome; you can add your comments to this post and get a discussion going. Be sure to tell me what you do and don’t like as things progress. And, if you have any wish lists for the site, now is the time to speak up.

Ready? Let’s get to it then!

October 26, 2011 Update:
I’ve finally started work on the changes. So far, I’ve changed the site’s overall design, removed a bunch of outdated content, and reorganized topics. I’ve also restructured the menu system at the top of the page. More changes coming. Bear with me as I continue working on this.

October 27, 2011 Update:
I’ll be spending most of today going through the 400+ posts uploaded here since 2003, weeding out the old junk no one cares about, and recategorizing and tagging what remains. Can you say tedious? But I think it’s worth it to have good, easy-to-find content here.

October 30, 2011 Update:
I finally finished going through all the posts on this site. I removed more than 100 out-of-date or uninteresting posts, leaving behind a total of 317 for your reading pleasure. All posts have been properly categorized and tagged. I also fine-tuned the layout, increasing the font size of the sidebar so people like me could read it. (Getting old sucks.) Next up, I’ll convert pages to posts and fit them into the hierarchy. I’ll also re-add the information about my work and contact form. Would love to get some feedback about the site changes so far. Comments, anyone?

.htaccess Modifications Boost My FeedBurner Numbers

The fruits of my labor.

Yesterday, I spent a good part of the day updating my site’s .htaccess file to redirect requests for my WordPress-generated feeds to my corresponding FeedBurner feeds. This included the main feed for my site as well as individual category feeds for my Book Support categories.

I discussed why I wanted to do this in a previous article, “The Definitive Guide to Apache mod_rewrite,” which includes a quick book review of the book I found extremely helpful to complete this daunting (for me, at least) task.

The resulting .htaccess file included a few RewriteCond and RewriteRule statements to point most feed requests to my FeedBurner feeds. I say “most” because, for some reason, I couldn’t get one of the RewriteRule statements to work.

Having trouble understanding what the heck I’m talking about? Here’s a way to look at the situation:

Think of all of the incoming feed requests as a flow of water coming into my site. I don’t want that water in my site — I want it at FeedBurner’s site so I can measure it and ensure consistent outflow. My RewriteRule and Redirect statements are like pipelines, each of which gathers a specific flow of water and delivers it to FeedBurner. I need one more pipe to capture the last trickle of water coming into my site. I think I have the right pipe, but the water’s not flowing into it.

(Sometimes I really do get carried away with analogies.)

Anyway, this morning I checked my Feedburner subscriber numbers. After all, if I started sending FeedBurner more of my requests, there should be more subscribers, right? The result had me pleasantly surprised: I had about twice as many subscribers today as yesterday for my main feed. It’ll be interesting to see what tomorrow’s number looks like.

I also made some changes to the category feed links (those tiny orange icons in a post’s header) so they’re redirected to the corresponding Feedburner feeds. Of course, this was only for my Book Support category topics. I don’t have a FeedBurner feed for every category on my site, so I couldn’t redirect them all.

What’s the benefit of a FeedBurner feed? Two obvious things that I can see:

  • Feedburner can track the number of subscribers to a feed, so you can instantly and easily see how popular a feed is. It also provides a bunch of other stats to help you understand what subscribers are interested in.
  • Feedburner’s BrowserFriendly feature takes ugly feed code and turns it into a Web page. So if someone clicks a feed link, they get something they can actually read in their browser. Best of all, there are buttons near the top of the page that make it easy to subscribe with a bunch of different popular feed readers. This is a great feature to convert newbies into subscribers.

I’m not completely done messing around with .htaccess on my site, but I’m taking a break from it. Sometimes when I hit a block, the best thing to do is walk away for a while and come back to it. I’ll get that last pipe working — but not today.

Anyone interested in seeing the .htaccess commands I used? Use the Comments link to let me know and I’ll put them online in another post.

WordPress Category Feeds

Did you read the article?

If you’re a subscriber or frequent visitor here, you may have caught my how-to article about including category feed links for each post’s category. You can see how this looks on every post on my site — at the top of the post is the category name with a tiny feed icon before it. Clicking the feed icon opens the RSS feed page for that category. You can copy the link and paste it into your feed reader to subscribe to the category.

I wrote the article right after I made this modification to my site. It seemed like a good WordPress trick to share with readers, so I put it online. At least 130 people read it on my site. But then I got to thinking about it and realized that I might have a good paying market for the article. I submitted it to my editor at Informit and they bought it. So I had to take it offline.

Fear not! Informit.com is a free source of articles on the Web. So when it gets through editing and into production, it’ll be back online there and I’ll have a link to it on this site. Unfortunately, that’ll take at least a month. I’m not their only writer and there’s plenty of other content for them to get online. I’m still waiting for four articles I’ve written for them in the past month to appear online — three of them are of special interest to WordPress users.

But I thought I’d take a few moments to explain why I went through the bother of creating category feed links here. Read on to see if this technique works for you.

Why Category Feeds?

Without repeating too much of what’s in my Informit article, here’s the deal.

Everything I’ve read about successful blogging says that a blog must have a specific topic to succeed. If you visit my Web site or subscribe to my primary RSS feed, you know that I’m just not following that rule. My site/blog covers all kinds of topics: computing for Mac users, computing for Windows users, flying, writing, photography, stuff going on in my life, travel, blogging, productivity, and so on. It’s a hodgepodge of information and opinion and I seriously doubt whether everything I write about is of interest to anyone.

While I could start multiple blogs, each of which covers a specific topic, I’ve been there and done that and I didn’t like it one darn bit. Too much work to do, especially when it’s time to upgrade!

Fortunately certain topics are of interest to a lot of different people. One person might like what I write about WordPress while another might like what I write about flying. Neither of them care a bit about the other topic. They don’t want to subscribe to my main feed to get the tidbits that interest them. They might not even want to visit the site regularly to see what’s new and interesting for them. They stop by once or twice, read things they like, see things they don’t care about, and forget to come back.

I want to capture those visitors and keep them coming back for more. I figure that the best way to do that is to offer RSS feeds (also viewable as “Live Bookmarks” in Firefox — my browser of choice — and possibly other browsers) for every topic on the site. This way, people who want to follow certain topics I write about can do it without having to wade through the stuff they couldn’t care less about.

How WordPress Makes this Easy

WordPress makes it easy to publish category feeds — it does it automatically. All a reader has to do is know the URL for the automatically generated category feed. And all I’ve done is give it to them on a platter, by creating a link with the feed URL beside the category name in a post header.

My article goes into the how-to aspect of this in some detail, with the code I used to make it happen. Copyright agreements prevent me from repeating that code, which is the main content of the article, here. (Sorry, but I do write for a living, which means I need to get paid for my work sometimes.)

I did write an article some time ago that explained how to create an RSS feed page like the one on my site: “How to Create a WordPress RSS Feed Page.” As that article explains, you can use the wp_list_cats tag to include your RSS feed link for a category in parentheses after the category name. That’s handy on an RSS feed page like the one I wrote about, as well as in sidebar listings of categories. For most folks, that’ll be enough.

I used a more “in your face” approach. I just hope it works.

Thoughts on the topic of category feeds? Use the Comment link to share them with other readers.

Reorganizing WordPress Categories

I do a little end-of-year cleaning.

I decided the other day that some of my blog’s categories were too similar to others (for example, Flying for Hire, Flying for Pleasure, and Flying Lessons) and that I wanted to trim down my category list to make room for new categories in the future. So I combined a few categories and added one.

When I combined Writing for a Living and Writing for Pleasure into one category (Writing), I did it the hard way: I edited all the posts in Writing for Pleasure to use the Writing for a Living category. Then I changed the Writing for a Living category’s Category Name to Writing and the Category Slug to writing. I renamed Writing for Pleasure as a new category called On Blogging with a category slug of blogging. This was extremely time consuming, since I had to modify each individual post and was working from home, with a miserable 256Kbps connection.

For the three flying categories, I decided to get fancy. I changed the name and slug of Flying for Hire, which had the most posts, to Flying and flying. Then I changed the default category (Options > Reading) to Flying. Then I deleted the Flying for Pleasure and Flying Lessons categories, clicking OK in the warning dialog that appeared for each one to allow the default category (Flying) to be assigned to each. This was certainly a faster way to get the job done, but it gave me quite a scare when the number of posts in the Flying category did not increase and the total post count decreased. Had WordPress actually deleted posts? I had to check the contents of that category to make sure I had posts from all three categories in it. I do, but the inconsistent count has me worried, so I don’t necessarily recommend doing what I did to combine categories. Ask me in a week or two and I’ll let you know what I think.

Of course, changing category slugs isn’t a good thing to do when you’re using one of the permalink options (Options > Permalink) to make “friendly” URLs. My changes affected five categories; any links to the old category slugs would break. So I opened my .htaccess file and added the following lines near the top:

Redirect permanent /category/weblog/writing-for-a-living/ http://www.aneclecticmind.com/category/weblog/writing/

Redirect permanent /category/weblog/writing-for-pleasure/ http://www.aneclecticmind.com/category/weblog/writing/

Redirect permanent /category/weblog/flying-for-pleasure/ http://www.aneclecticmind.com/category/weblog/flying/

Redirect permanent /category/weblog/flying-for-hire/ http://www.aneclecticmind.com/category/weblog/flying/

Redirect permanent /category/weblog/flying-lessons/ http://www.aneclecticmind.com/category/weblog/flying/

Keep in mind here that all of the categories I changed are actually subcategories of the Maria’s Weblog category, which has a slug of weblog. Each of these lines automatically redirect the old category URL to the new one. You can learn more about .htaccess at one of my favorite online sources: Stupid .htaccess Tricks.

The net effect of all these changes? Five categories have been combined into two and a new category has been created. My links should continue to work as they did.

Now let’s just hope I didn’t lose any posts or screw up that .htaccess file…

More Bad Behavior

I update some software to help keep spammers off the site — and preserve my bandwidth.

Miraz introduced me to the Bad Behavior WordPress plugin some time ago, and after ascertaining that it did indeed work with a GoDaddy.com hosting account (my hosting ISP), I installed it on all of my WordPress-based sites. What I saw was an immediate reduction in the amount of spam that Spam Karma was catching. That wasn’t because it made Spam Karma less effective; it was because less spam was actually accepted by WordPress for moderation. I can verify this by checking the Bad Behavior stats — it catches roughly 7,000 potential spam hits a week on just one of my sites. That means my server doesn’t have to work so hard and, as a result, it can be more responsive to visitors.

One of the drawbacks to hosting multiple sites on a budget is the limitations imposed by my ISP for my level of hosting. I’m allowed 100 concurrent hits — to all sites on my hosting account. I have two very busy sites online and I think they sometimes fight with each other for bandwidth. This hasn’t been a problem until lately — the other day I started getting Error 503 messages (server busy) when trying to access my sites.

I investigated and discovered that at the time I was trying to view my site, Spam Karma had caught roughly 200 spam messages in the span of 3 minutes. No wonder my site was busy. Spam Karma was fighting off spammers. But what the heck was Bad Behavior doing? Sleeping on the job?

I went to the Bad Behavior Web site and noticed an update that should resolve things. More spammer-stopping power. I downloaded and installed it. If the Error 503 messages become less common and Spam Karma catches less spam, I know it’s doing its job.

The point is this (yes, there is a point): if you have a WordPress blog that allows comments, having spam protection is more than just preventing your site from being filled up with spam comments. It’s protecting your bandwidth. And for that, Bad Behavior seems like a good solution. Just be sure that you have the latest version.

And, if you find your spam prevention software helpful, be sure to send a few euros to the developers to keep them interested in keeping the software up-to-date.

December 14 Update: I just did some more research over at Lunacy Unleashed, Web site for Michael Hampton, the developer of Bad Behavior. His article, “Spam Surge,” seems to collaborate what I’ve been experiencing. Apparently, the spam surge also affects e-mail accounts. (My e-mail spam increased considerably about a month ago but has since tapered off to manageable levels.)

Reader Engagement Site Improvements

I add a few “engagement” features to this site.

Blogging is more than just using blogging software to create and edit posts. After all, if someone shouts in an empty room, does her voice make a sound? An important part of blogging is to attract and retain readers. That’s where content, SEO, and site design come into play.

I’m a strong believer that once you get a visitor to your site, the site’s overall design can help keep them there, at least for longer than the average 30 seconds. (Read Jakob Nielsen’s books for the sad truth about site/page visit lengths.) You can do this by making sure the site is legible and by including navigation features that make it easy to find interesting content.

I read an excellent article on Connected Internet today: “Best WordPress Engagement Plugins: Make Users Read More Posts“. The author lists several plugins — some of which I already use or have tried in the past — that’ll help keep site visitors on your site, reading more content. I added two of them today.

Readers Posts

Readers Posts is a plugin that offers three features:

  • Within The Loop, indicate how many readers have read a post before you.
  • List the most recently viewed posts.
  • List the most viewed (i.e., popular) posts.

I installed the second of these three options in the sidebar of aneclecticmind.com. It began working immediately, drawing information from the WordPress database to list the ten most recently viewed posts. Refresh the page after a few minutes and the list changes. This site has, on average about 5 visitors online at any time and they don’t always come to the site’s Home page. That, of course, is the drawback of any plugin that lists recently read posts — it only lists the posts that have been read on their own page — not on the Home page or archive page. In a way, that’s a good thing. It means the person reading a post is reading it because he found it via a search engine or used a link on the site to read it. He’s reading it because he wants to read it (or thinks he does; as we all know, search engines don’t always display desired results). That’s more meaningful than Home page reads, which could include lots of articles that the visitor just isn’t interested in at all.

The benefit of this: site visitors are shown a list of articles that other visitors have found interesting. I love this feature because it shows me what people are coming to the site to read and it helps me write more content of interest to visitors.

If you try this plugin, don’t be alarmed when you click the link above and arrive at a German-language site. Scroll down on that page and you’ll find an English-language translation. Although it isn’t perfect grammar (what is?), it’s certainly good enough to understand the installation and configuration process.

Landing Sites

Landing Sites is a very cool plugin that does a bunch of things, when installed correctly:

  1. It checks to see if the visitor was referred to the page from one of several popular search engines. It the visitor has not, it stops working.
  2. It displays a message with the name of the search engine and the search word(s) or phrase used to find the page.
  3. It displays a list of links to posts on your site that also match the search criteria.

What I like about this plugin is that it only displays content if a visitor has arrived at the site by clicking a link in a popular search engine’s results list. I put it at the top of the sidebar, where visitors are most likely to see it when they arrive at the page.

Installing the plugin isn’t difficult, although you really do need to follow the instructions on the page you download it from. If you copy and paste the code right from that page, you’ll need to modify all the single and double quote characters so they’re straight quotes when pasted into your template file. (I didn’t notice this at first and got PHP errors. It was an easy enough fix.) The result is what you see if you happened to arrive at a page on my site via popular search engine results link. You can try searching for Hermosa Ranch Insanity (the test link I used) and clicking the link to content on my site to see what I mean.

The benefit of this, of course, is that if the article the visitor came to read isn’t enough for him, he’s given other possible articles to try. He may or may not follow the links, but at least they’re there for him. You could keep him on the site longer.

Conclusion

Read the Connected Internet article. It tells you more about these two plugins, as well as others I currently use or have tried in the past. You might find overlap among features; pick the plugin you like best. Give them a try and see how they affect your visitor stats.

Blogroll Links

I tweak some settings to support more blog links without using up too much sidebar space.

This site doesn’t include a lot of links to blogs. One of the reasons for that is that I’m extremely particular about the sites I link to. I don’t link indiscriminately. I only link to sites I think are worth visiting.

And as we all know, there are just too many sites out there that just aren’t worth visiting.

The other reason I don’t have a lot of blog links is that I just don’t want my Home page sidebar to get too long. It’s already very long — if I wrote shorter entries, it would easily exceed the length of my entries as it often does on wickenburg-az.com.

So today, in preparation for supporting more blog links, I converted my WebLogs link category to a true blogroll, with a limited number of links. If I have more than the number of links I specified (5), WordPress will randomly choose which links to display each time the Home page is opened.

Setting this up in WordPress is easy. Here are the instructions for a server installation of WordPress:

  1. Log into WordPress and go to the Dashboard.
  2. Click the Links button to view the Manage Links administration panel.
  3. Click the Link Categories button to view the Link Categories Administration panel.
  4. Click the Edit button for the category you want to limit entries for. You’ll see the Edit Category administration panel for that category.
  5. In the Category Options area, enter a value in the Limit box and choose Random from the Sort Order drop-down list.
    Setting Up a Blogroll
  6. Make other settings as desired in the administration panel.
  7. Click the Save Category Settings button. WordPress saves your settings and brings you back to the Link Categories administration panel.

From that point forward, the links in the category you modified will be limited to the number you specified, randomly selected and displayed. To display more or fewer links, just repeat these steps and change the value in the Limit box.

WordPress.com handles links and categories a bit differently. If you need instructions for doing this on a WordPress.com blog, use the Comments link for this post to ask and I’ll whip them up.

WP-Print

I add a post printing function to the site.

One of the things that bugs me about WordPress is that when you print a page, the resulting printout does not have the same formatting as the page in your Web browser. Instead, styles are pretty much stripped out and sidebar components are added to the end (at least in my case) to the printout. This makes the printout longer than it needs to be.

Enter Lester Chan‘s WP-Print plugin. It enables you to add a Print link to your posts. When a user clicks the link, the plugin creates a simply formatted page with the page contents and URLs. You can then click a link on that page to print the formatted page.

It’s a much nicer solution than just printing from WordPress.

Added Gravatars to Comments

Or at least I think I did.

I should get my head examined. I just added another WordPress plugin. That’s two in about two hours.

This one adds gravatars to comments. A gravatar, in case you don’t know, is a globally recognized avatar or image associated with a person. Or, in this case, a person’s e-mail address.

To get a gravatar, sign up for a free account at gravatar.com, complete the registration process for your e-mail address, and upload an 80×80 pixel JPEG or PNG image you want to appear as your gravatar. The staff at gravatar.com will rate your image so if it’s not appropriate for some sites, it won’t appear there. Then, when you enter a comment on a gravatar-enabled blog or site, your image will appear with your comment.

I say I think I set it up properly because although I installed the Gravatar plugin for WordPress and inserted the code in the comment loop, I don’t have any comments from people with gravatars. (Mine hasn’t been approved yet.) So I can’t see if it’s working.

If you have a gravatar rated R or lower and want to show it off (and help me determine whether the plugin is working), add a comment to this post.

Otherwise, I’ll just have to wait until I’m rated and see if I appear.

Trackback Troubleshooting

I spend most of a day trying to figure out why I can’t send trackbacks from my blog.

If you follow this blog, you’ll know I’m working on a book about WordPress with Miraz Jordan. We split the chapters down the middle, with me getting the first half and Miraz getting the second. One of my chapters covers comments, trackbacks, and pingbacks, three features of WordPress that allow feedback and interactivity between blogs and readers.

On my two WordPress-powered sites, the comments feature works fine. A bit too fine, in fact, as the sites quickly became victims of comment spam. Fortunately, Dr. Dave makes a great comment spam prevention plugin for WordPress called Spam Karma and that catches about 99% of the spam aimed at my two sites. I can easily catch the rest using WordPress’s built-in moderation tools. I’ll be covering all this information in detail in Chapter 4 of our book.

I never really experimented much with the trackback and pingback features. Rather than going into a long, detailed explanation of what these features are, if you’re interested (and can’t wait for the book), you can visit the WordPress Trackback Tutorial on Optiniche.com.

One thing I will point out here is that pingbacks are automatic notification of a blog that your blog refers to it. For example, so far I’ve provided links to two specific blog entries (one on Dr. Dave’s site and one on Optiniche). Because WordPress is configured to automatically notify compatible sites when you link to them, a comment should be created for blog entry I linked to, providing an excerpt from my post and other information. You can see an example on this site from Miraz in the comments on this post. Even the link I just created to my own blog entry should result in a pingback to my blog.

Unfortunately, none of this is working. And yesterday, I spent a good part of the day troubleshooting to find out why. After all, it’s difficult to write about something when you can’t get it to work right.

Don’t get me wrong — I know exactly how it should work. I’ve probably read more about the trackback feature in the past two days than most WordPress users read in their lifetimes. And I tortured Miraz yesterday by asking her to trackback and pingback to my site to make sure I could receive these. (I can.) I just can’t send them.

Oddly enough, I attempted to create a trackback from my demo WordPress.com blog. It appeared to go to its destination, but it never showed up there.

In troubleshooting, I found two possible problems mentioned in the WordPress Codex, both of which will require a visit to the server where the sites reside.

First, there’s some indication that the pings might be “stuck” in a queue, resulting in an endless loop while WordPress tries to send them. I’m not so sure about this. It seems to me if that there was some kind of loop thing going on, WordPress would be bogged down by the effort. Yet my two sites seems to perform okay. Still, the cure seems to be to use some MySQL commands to flush out the contents of the to_ping field. Since I don’t think it will hurt anything to do this, I’ll give it a try.

Other people experiencing this same problem claim that this does not help. One person believes it has to do with a blog getting very large and a memory problem resulting. I can believe this with my blogs. Although I only have about 400 entries in each, the entries in this blog tend to be very lengthy. Add to that my love of customization via plugin and you have a very busy WordPress trying to do all kind of things with lots of data. To fix this, I need to visit my server and make some changes to the php.ini file. (I already tried modifying .htaccess, as the article suggests, but that doesn’t appear to help.)

I’m also thinking at this point that it may have something to do with a recently installed plugin. On this site, my automatic database backup stopped working, although it continues to work reliably on wickenburg-az.com.

Am I pushing WordPress too hard? Perhaps. Hopefully I’ll resolve this problem soon so I can back to work.

Oh, and if you have any suggestions for me, please don’t keep them to yourself.

Adding “Intelligence” to WordPress

Teaching myself new WordPress tricks.

I made the big decision yesterday that I was going to combine the LangerBooks.com Web site, which is currently in a very sorry state these days, with this site and blog. But that opened up all kinds of new challenges for me.

The big challenge was making book-specific files and links available on just those pages that applied to the book in question. Although I could just put the links in a post and be done with it, I wanted a nicer solution. I wanted those links to appear in the sidebar for that book.

Keep in mind here that LangerBooks.com needs to support eight current titles as well as a catch-all title for out-of-print books. I created an individual WordPress category for each book and one for the catch-all. So I needed nine custom sidebars, as well as the sidebars that would appear on static pages, blog pages, date archive pages, etc.

There were a number of ways to do this and I chose what I thought was the most straightforward way. I used conditional statements to query WordPress about the type of page it was displaying and then generate a custom sidebar for that page on the fly.

This required me to roll up my sleeves and dig into PHP, which I don’t really know. Fortunately, I have a knack for looking at code and experimenting with it to see what it does. And although the search feature for WordPress.org’s Codex isn’t working right, Google can still find and display those documentation pages. So I did a lot of Google searching to find reference material, experimented, and came up with code that would work.

The unfortunate part was that there was no clear instruction to tell me what to do. There were some instructions that gave me bits and pieces of what I had to do. I just put things together to try them out and was very surprised when I didn’t get error messages.

The result is the custom sidebar that appears for the Book Support categories (I currently have 3 of the 9 done) as well as for single pages for a specific category. That’s where I got very fancy, using “and” and “or” codes to string PHP commands. Here’s what I mean; if you know PHP and WordPress, you’re likely to know what I did, too:


    Put stuff to appear on every page here
<?php if (is_home()) { ?>
&nbsp;&nbsp;&nbsp;&nbsp;Put stuff to appear on the home page only here
<?php } elseif ( is_category('24') || is_single() && is_category('24') ) { ?>
&nbsp;&nbsp;&nbsp;&nbsp;Put stuff for MAC OS VISUAL QUICKSTART GUIDE here
<?php } else { ?>
&nbsp;&nbsp;&nbsp;&nbsp;Put stuff for pages that don't meet above criteria here
<?php } ?>
&nbsp;&nbsp;&nbsp;&nbsp;Put stuff to appear on every page here

Of course, this is a highly simplified illustration of the code that works. In my example, I have lots of elseifs and more than one batch of conditional queries. This might be child’s play for some of you WordPress power users, but it’s all new to me and very rewarding when I get it right.

The trick when doing all this is to get the items you want to appear in the sidebar in the order you want them to appear on the pages they should appear. It’s a good exercise in logic and I think it really helped clear the cobwebs out of my mind.

Three down, six to go. Time to finish up.

Later…

I’m about 90% done — done enough to go live with the “sites.” I still have to find and make available a bunch of files for books, including my Excel VQS and my two out-of-print FileMaker Pro books, which still seem to have a bit of life left in them. And I’d like to create a post for each book category that lists all editions of the book — some of them have quite a few editions. And maybe dig up and display all the book covers.

But for now, I’m done. My sidebar.php file is currently 450 lines long — and I don’t use many blank lines. I think I might make my entire theme, a highly modified and plugin dependent version of Exquisite, available for download when I’m finished with the WordPress book Miraz and I are writing.