Category Archives: WordPress

New blog theme

If you’ve visited my blog in the last few days, you’ll notice that I changed the theme. After trying out a few themes, I’ve settled on Suffision, which is very customizable with over 20 pages of options. I’ll continue to fine-tune it. I also made my software page the default home page, to emphasize my iPhone applications.

Another way to block the Digg Bar

A lot of developers don’t like having their sites loaded into a frame with Digg’s new DiggBar, inspiring several scripts to get rid of the bar. John Gruber came up with a short PHP script that prevents the page from loading with a nasty message if it detects that it’s being loaded in DiggBar’s frame. Gruber’s script inspired Phil Nelson’s WordPress plugin, which adds that script to any WordPress site.

I decided on a different route, using JavaScript instead of PHP and reloading the page outside the frame instead of displaying a message. The result is my Undigg WordPress plugin, which you can download here.

My plugin simply adds the following bit of JavaScript code to the page:

<script type="text/javascript">if ((top !== self) && ((document.referrer+"").substring(7,11) == "digg")) top.location.href = self.location.href;</script>

This is very similar to a standard frame killer, except it only affects the Digg bar while letting other frames load your page.

To install it, unzip the archive, drop ‘undigg.php’ in /wp-content/plugins, and enable it in the plugins screen.

Best WordPress theme ever

I’ve found the perfect WordPress theme, Atahualpa from BytesForAll, which I’m now using at MacMegasite. Every aspect of the theme is completely customizable with 25 pages of options. I highly recommend this theme. With all of those options, you can easily make it your own.

WP-O-Matic FAIL

If you follow me on twitter, you probably saw about 32 tweets spew from my blog, thanks to WP-O-Matic blowing chunks all over my blog, which Twitter Tools dutifully reported as new posts.

I’m attempting to set up automatic photo blogging from my Flickr photo stream. Flickr produces RSS feeds for each tag, so I’m using the tag photoblog to have those images posted here automatically by subscribing to the resulting feed. Unfortunately, Flickr’s tag feed URL has several characters such as ‘?’ or ‘&’ that WP-O-Matic choke on. As a result, instead of seeing my tag feed, WP-O-Matic saw my entire photo stream. Furthermore, although I limited it to post only 5 items, it decided to post each item multiple times.

A work-around for the URL problem is to use a URL shortener such as tinyurl to generate a clean URL for WP-O-Matic. I’ve made it create new items as drafts instead of publishing immediately, so it shouldn’t happen again.

New Blog Editor

Blogo is a very intriguing new blog editor with some very unique features, including a built-in Twitter client. It has a very nice rich text editing mode as well as a HTML mode.

Unfortunately the user interface is a lot more cluttered than MarsEdit and, at least for a long-time MarsEdit user, a lot less intuitive.

Blogo
Uploaded with plasq‘s Skitch!

I really like the built-in Twitter client, but the editor looks un-Mac-like. I also find that switching between rich text & HTML modes inserts some extraneous tags. At least for now, I’m sticking with MarsEdit because it looks a lot more Mac-like and feels a lot smoother.

MarsEdit
Uploaded with plasq‘s Skitch!

I started this post in Blogo but ended up using MarsEdit after it messed up the embedded images.

Sticky Posts in WordPress 2.7

One of the new features in WordPress 2.7 is “sticky” posts, which will always appear at the top of the home page. The option is pretty well hidden, so unless you know where to look for it, you probably won’t find it.

In the edit or create post screen, there’s a publish options box which lets you specify the visibility for that post, with an ‘edit’ link next to it.

publish options.jpg

Click the edit link and it will expand the box to show the options, including a ‘sticky’ checkbox.

Publish Options Expanded.jpg

You can test for sticky posts in your theme using is_sticky() and change the appearance to highlight those posts.

In the theme’s index.php, alter the class of sticky posts with code similar to this:


    <?php while (have_posts()) : the_post(); ?>
       <div class="post <?php  if (is_sticky($post_id)) { echo 'sticky'; } ?>" id="post-<?php the_ID(); ?>">
 ...

Finally, add a ‘sticky’ style to the theme’s style.css, for example:


.sticky {
	background: #dde;
	padding: 5px;
}

MacMegasite updated to WordPress 2.7

I’ve upgraded MacMegasite to WordPress 2.7. As always, the upgrade was quick and painless: I simply uploaded the files (after backing up the old version) and updated the database through the admin screen. In less than 10 minutes it was back up.

WordPress 2.7

I’ve upgraded this blog to WordPress 2.7b3. As always, the upgrade was quick & painless. The only plugin that broke is Leopard Admin, which isn’t really that important any more with the new admin dashboard. I’ll probably upgrade MacMegasite in a few days after more testing to make sure it doesn’t break the forums & other plugins.

Malicious fake WordPress site

Lorelle warns about a malicious fake WordPress site that looks like the real one, but isn’t. There is no WordPress 2.6.4. The latest version is 2.6.3. If you “upgraded” to “2.6.4″, then you have installed a fake trojan version (more details here and here). If you’ve “upgraded” to 2.6.4, delete your wp-admin and wp-includes folders and replace them with fresh copies from wordpress.org. More detailed instructions for cleaning up are available here.

A benefit of switching to WordPress

I upgraded a local copy of MacMegasite to WordPress 2.7 beta 1, which took less than a minute and didn’t break anything. A major Drupal upgrade like that would result in hours or even days of pain trying to fix everything it broke.

I probably won’t upgrade the live site to WordPress 2.7 until at least the release candidate is available, but I’m sure it will go just as smoothly.

This illustrates the big difference between Drupal and WordPress. Drupal makes no attempt to preserve backward compatibility with themes & modules. They even consider it a virtue, making bigger advances possible. Unfortunately this causes lots of pain for people running Drupal-based sites and makes it very difficult to update.

WordPress, on the other hand, manages to maintain full compatibility between releases, yet they still manage to make a big advance in capabilities.