Domain changed!

So I changed the domain to WPressureCooker.com.

I thought I’d share how I did it to show how to do it so you don’t have to worry about folks trying to get to your site through the old domain and getting a 404/”file not found” message.

The first thing I did was some research to find the best way to do this.

Quick disclaimer: This may not be the best way for your site.  But this worked for me.  Be sure to back up your database and files before proceeding.

I followed the Yoast.com site’s advice and created a robots.txt file, but ended there because I was not moving any files and he was giving instructions for an Apache server where I was using a Windows server hosting plan.

In my Godaddy hosting account, I set the new domain (wpressurecooker.com) to point to the same folder wordpressurecooker.com is pointing to, and waited for the status to go from Pending to Setup.

Logged in my site’s admin and went to the General settings.  There I changed the Blog URL and Site URL to the new domain name.

I installed the plugin, Domain-Change by Soz which creates the 301 Redirect for you that automatically redirects folks from your old domain to the new.  So if someone comes to your site by a link that goes to a specific article, the page comes up under the new domain.  Even my shortened Pretty Links worked.

I deleted the robots.txt file from my site.

Next came the stat tracking.  I use Google Analytics.  I was hoping that the 301 redirect will take care of most of the problems, but just in case, I made a change to my Google Analytics account and the Google Analytics for WordPress by Joost de Valk settings.  There is the possibility I did this wrong, but in Google Analytics for wordpressurecooker.com I set it to track “multiple top level domains”.  I noticed the code (that you would paste in if you didn’t use the plugin) changed where _gaq.push([‘_setDomainName’, ‘none’]); so in the plugin settings, I set Domain Tracking (which sets _setDomainName) to “none”.

I also have WordPressurecooker.com registered under Google’s Webmaster Tools.  That required me to verify the wpressurecooker.com domain, then for wordpressurecooker.com, I clicked “Change of address” under “Site configuration” I set the New URL for wordpressurecooker.com to wpressurecooker.com.  In the settings for wpressurecooker.com I set the sitemap URL.

It took me a lot longer to type this all out than to make the changes, so I think you will find it pretty easy.

So did I miss anything?

I need to change my domain name

According to this, I need change my domain name because it contains the word “wordpress”.

I understand why, but I don’t have to like it.  I mean, c’mon… WordPressureCooker is pretty clever, IMNSHO.

But I can change. If I have to. I guess.

But to what?  According to the article, I can use “WP” in my domain name.  I have already registered “wpcooker.com” and “wpressurecooker.com”.  I like “wpcooker.com” because it’s shorter, and “wpressurecooker.com” because it includes “pressure cooker”.  Perhaps I can just use wpcooker.com as a URL shortener for my site.

What do you think? Which domain name should I go with? Please leave your suggestions in the comments.

WordPress 3’s New Menus

WordPress 3 has brought forth some new tricks like the customizable navigation menus which make it very easy to set up your own menus using a GUI. You can define and drag-and-drop the order of the menu items, and WordPress will output them as an unordered list (<ul><li>…</li></ul>).

Rather than try to explain it myself, just head over to Justin Tadlock’s post about the menus.

One missing piece was filled by John The Developer where I needed to add a custom class to the last menu item.  I was displaying a menu horizontally and using “margin-right” to space the menu items (inside <li> tags) apart, but I didn’t want that margin on the last item.  Here is John’s 8 lines of code solution.

Then in my CSS file, I defined “last-item” class as:

li.last-item {
     margin-right: 0 !important;
}

I did try using the pseudo-class of li:last-child which worked fine in Chrome and Firefox, but it did not work for Internet Explorer because IE has yet to recognize pseudo-classes.

Update Bonus: Want to add some collapsing menu goodness? Check out Daneomatic.com’s post.

Gaps in emailed HTML table rows

This post has nothing to do directly with WordPress, but this is a little tip I need to post to remind me how I fixed this particular problem.

Because of restrictions in certain email clients, I still rely on HTML tables for newsletter layouts.  When I cut up an image and place the image slices in individual table cells, the result looks fine in a browser by itself, but when sent and viewed in Gmail, there is a noticeable gap between the rows.

The browser’s element inspector says the row height is computed to 2 pixels larger than the image size despite entering the correct height in the row and cell.

I found entering the line-height attribute set to zero fixes the problem.  In each row tag enter

style=”line-height:0;”

so your row tag looks like <tr style=”line-height:0;”>

You will also need to add line-height attribute to a <p> or <span> tag around your text so it’s not all bunched up together.  Setting line-height to equal or greater than the pixel height of your font-size should do it.

FeedWordPress making invalid RSS?

As I mentioned in my last post, I’m using FeedWordpress to syndicate affiliate links.  I turned on the option to have the permalink to the affiliated articles to go straight to the affiliate link instead of the page (that may be bad for SEO, but one less click for visitors).

The problem was the RSS feed became invalid because of the affiliate link.  So I need to encode the link.  So on line 590 of feedwordpress.php, I changed

$uri = get_syndication_permalink();

to

$uri = esc_attr(get_syndication_permalink());

The esc_attr function is a built in WordPress function that converts certain characters to their HTML encoded equivalents. Such as “&” becomes “&amp;”.

Everything seems to be working fine now.