Maria’s Guides

Support and additional material for readers of books, articles, and digital media by Maria Langer.


Random Book Cover #1Random Book Cover #2Random Book Cover #3Random Book Cover #4Random Book Cover #5Random Book Cover #6Random Book Cover #7Random Book Cover #8Random Book Cover #9

links for 2007-01-27

Posted on January 26th, 2007 at 11:17 pm · No Comments
Filed in: RSS Links Worth Following   

→ No Comments • Read 171 Times
Add to Del.icio.usAdd to Del.icio.us • Technorati ThisTechnorati This • Digg ThisDigg This • Stumble ItStumble it! • Twit ThisTwit This


Upgrading WordPress to 2.1: Fixing the ecto Category Problem

Posted on January 26th, 2007 at 11:57 am · No Comments
Filed in: RSS WordPress Books   

Problem found and resolved.

I use ecto to post to all of my blog-based Web sites. It’s a great offline post composition/editing tool that gives me all of the tools I need to get the job done.

Yesterday, I updated our WordPress 2: Visual QuickStart Guide companion Web site to WordPress 2.1 Today, I discovered that I could no longer load or “refresh” that site’s entries in ecto. When I tried, ecto would get hung up while “retrieving categories” for the last entry created.

I poked around in the ecto support forum and came up with this thread. Evidently, I wasn’t the only one having the problem. The ecto folks claimed it was a WordPress problem that had to do with the xmlrpc.php file (which resides in the root directory of a WordPress installation). I followed the thread until I came up with this fix by gusleig:

You must edit your xmlrpc.php. Find:

'categoryId' => $catid,

and change to:

'categoryId' => (string) $catid,

I followed these instructions, saved the modified xmlrpc.php file, and tried ecto again. It worked.

The folks at WordPress are aware of the problem. If they haven’t already fixed this on WordPress.com, I assume they will shortly. And the xmlrpc.php file modification will be in place in the next release of WordPress, so be sure to make sure you have a problem before you try this fix.

→ No Comments • Read 294 Times
Add to Del.icio.usAdd to Del.icio.us • Technorati ThisTechnorati This • Digg ThisDigg This • Stumble ItStumble it! • Twit ThisTwit This


Upgrading WordPress to 2.1: Fixing Link Lists

Posted on January 26th, 2007 at 10:05 am · 1 Comment
Filed in: RSS WordPress Books   


An unexpected side effect to upgrading.

This afternoon, I did my first WordPress 2.0.4 to WordPress 2.1 upgrade. The site I chose for the upgrade was the companion Web site for the WordPress book I co-authored with Miraz Jordan, WordPress 2: Visual QuickStart Guide.

I followed the official WordPress Upgrading Instructions. (I am not an idiot.) I also followed the instructions I included in the first article of this series, “Upgrading WordPress to 2.1: Dealing with Plugin Compatibility,” to make sure my plugins were compatible and to get updates of plugins that were installed.

The upgrade went pretty smoothly. I updated 3 of the 10 plugins Miraz and I use on the site and inserted some if-then logic to disable plugin-specific code when a plugin isn’t available. Then I backed everything up, turned all the plugins off, and started the upgrade.

When the digital dust settled and I was able to view the site again, I was pleasantly surprised. Most of the site looked just fine. I enabled the plugins one-by-one and tested the site again after each one. I discovered that Rate My Stuff and CG-Feedread, which weren’t listed as plugins that worked with WordPress 2.1 did indeed work. (I added them to the list in the Codex.) The Search Pages plugin didn’t cause an error message, but didn’t seem to work, either. In addition, there appeared to be a slight formatting problem with the form generated by WP-ContactForm; but it may have been like that before the upgrade. And, of course, WP-Cron is no longer necessary, since periodic backup is now built into WordPress 2.1 with WordPress Database Backup 2.0.

There was, however, a relatively serious problem with the links list. This has to do with the way WordPress 2.1 handles link categories and changes made to the tag we used to display them: wp_get_links.

Book CoverIn WordPress 2.1 links are now called bookmarks. And link categories have been merged with post categories, which are just called categories. Sound familiar? It should. That’s the way links and categories have been handled on the WordPress.com site for close to a year now. (Consult pages 69-73 in our book.)

To make this work, the upgrade process renumbers all of the link categories (unless they have the same name as a post category, I suppose). This isn’t a huge deal unless you use tags that refer to link categories by their numbers — as Miraz and I did. As a result, the <?php wp_get_links(3); ?> tag we had in the sidebar (for example) didn’t display anything because there weren’t any links in post category 3. This problem existed for all of the links we listed by category in the sidebar. All that displayed were the h2 level headings for each group of links.

Our Links ListWhen I discovered the problem, I substituted the new category numbers into the tags. The result was a list of link names and descriptions, formatted without bullets (see illustration). This isn’t the way it appeared before the upgrade.

At first, I thought the wp_get_links tag had been changed. But that wasn’t the case. Instead, WordPress 2.1 changed the information it recorded for links. In previous versions, it enabled you to include “before” and “after” attributes that were used, by default, to display links in a list. Those fields were gone, so “before” and “after” attributes had to be manually included with the wp_get_links tag.

It turns out, I needed to provide some additional attributes. Here’s what the wp_get_links tag needed to look like:

<?php wp_get_links('category=9&show_description=0&before=<li>&after=</li>'); ?>

Our Links ListThe resulting list looked like it always did (see image). I modified all of the tags as necessary, saved the modified template file, and was done.

In researching this problem, I looked into the Codex’s list of link tags. I noticed that there are some new link tags that will only work in WordPress 2.1. Unfortunately, the Codex entries for these tags were not complete when I consulted the Codex today. The one that appeared complete (but is still being edited) is wp_list_bookmarks, which I thought would meet my needs. Unfortunately, I was unable to get the desired results with this tag, even when using the attributes discussed in the Codex. I’m not sure if the information is incorrect or incomplete or I just made some kind of mistake I can’t figure out.

In any case, be aware of changes to the way links are displayed on your site when you upgrade to WordPress 2.1.

And stay tuned; I’ll be sharing more tips about completing the upgrade as I continue to upgrade my six WordPress-based sites.

→ 1 Comment • Read 682 Times
Add to Del.icio.usAdd to Del.icio.us • Technorati ThisTechnorati This • Digg ThisDigg This • Stumble ItStumble it! • Twit ThisTwit This