Beta Testing WordPress 2.5

I’ve been playing around with the beta version of WordPress 2.5 mainly to see if my plugins are going to break in this version. I’ve only tested Post Avatar but no problems so far. The main change will involve changing the display HTML since WP 2.5 is a complete overhaul of the admin panel.

Screenshot of WordPress 2.5 menu Aside from the initial reserve about the color scheme – it seemed a little washed out, I’m enjoying what I’m seeing. I like how the menu is set out with usual tasks of writing and managing posts and comments on one side and options for settings and plugins on the other.

The HTML has been simplified going from WordPress 2.3.3:
<div class="dbx-box-wrapper">
<div class="dbx-handle-wrapper">
<h3 class="dbx-handle"><?php _e('Post Avatar'); ?></h3>
</div>
<div class="dbx-content-wrapper">
<div class="dbx-content">
<!-- Content Here -->
</div>
</div>
</div>

to :
<div id="gkl_postavatar" class="postbox closed">
<h3><?php _e('Post Avatar'); ?></h3>
<div class="inside">
<!-- Content Here -->
</div>
</div>

Another thing that I like is the media uploader. I’ve only used the existing file uploader in WordPress sparingly – but the new uploader makes it easier to add files. There’s some kind of gallery tag which I need to check out. Hopefully this lets you display a group of uploaded images in your post.

WordPress 2.5 - Advanced Options

The one thing that I’m not happy about is the Advanced Options portion of the Write Post screen. It seems silly to have all this space for a single input box or a few checkboxes.
You have to click on the Comments and Pings header to view the two checkboxes and make the changes. It would be better if they were below the Save/Publish box.

Upgrading to WordPress 2.3 – The Tag Issue

With WordPress 2.3 expected out on September 24th, I’ve been giving the beta releases a whirl to see how what I need to do before I make the final change over.

I currently have 17 plugins(!) installed but I’m most concerned about Ultimate Tag Warrior – will it work in WP2.3?

Short Answer: Not really.

UTW doesn’t play well with WP2.3. Tags show up on posts but there’s a “No Posts Found” error on the link to see other posts with the same tag.

Since I’m only using a small portion of UTW’s capabilities: tagging posts, displaying those tags in my posts and a tag index, I ended up using the UTW importer.

The UTW Importer

Tagging problems in WordPress 2.3While all the post relationships and tags are passed over, tags with more than two words are hyphenated. Yikes! It seems that the importer considers tag names and tag slugs to be the same thing. Hopefully, that will be fixed soon.

Formatting Tags

With WordPress 2.3, there’s a number of tag-related template tags you can use: the_tags(), wp_tag_cloud. Rich Gilchrest has a helpful guide for updating your theme.

But wait, aren’t tags generally lowercase? Yes they are but as you can see in the screenshot above, there are some tags like “post avatar” and “wordpress” that appear as “Post Avatar” and “WordPress”.
This happens when a term, in this case “Post Avatar”, is shared by both a tag and a category. To get around this issue, you can define a css class to use in your templates and set text-transform to lowercase.

.post_tags { text-transform: lowercase}


So, inside index.php, archive.php and single.php I changed the format of the_tags to:

<?php the_tags('Tags: <span class="post_tags"', ', ', '</span><br />'); ?>

For wp_tag_cloud(), your styling options will depend on the cloud format that you choose.

By default, tag cloud formats to “flat”, generating a space separated list of your tags. So your template could look something like this:

<p class="post_tags"><?php wp_tag_cloud(); ?></p>

If you format it to “list”, you will get an unordered list (ul) with the class “wp-tag-cloud”.

Update your css file to reflect this new class:
.post_tags, .wp-tag-cloud { text-transform: lowercase }

The Tag Index

Creating an index of all your tags is quite simple.
First, create a new template (I called mine “Tag Index”) which contains the wp_tag_cloud with the following parameters:

<?php wp_tag_cloud('format=list&smallest=12&largest=12'); ?>

  1. format: I set this to “list” to create an unordered list
  2. smallest and largest: I made the font sizes equal so there would be no trace of the cloud effect. In this case the font size is 12pt

Using the Default Theme as an example, this is what your final template will look like…

<?php
/*
Template Name: Tag Index
*/
?>
<?php get_header(); ?>
<div id="content" class="widecolumn">
<h2>Tags</h2>
<?php wp_tag_cloud('smallest=12&largest=12');?>
</div>
<?php get_footer(); ?>

Now upload your template and once you’ve done that, create a new Page and assign the “Tag Index” template to it.

Also make sure that the Page Slug is “tag”. If you’re using pretty permalinks you can access your tag index from http://yourdomain.com/tag/.

Whew! One plugin down, 16 more to go!

Moving Your WordPress Installation? Consider This!

There are some great articles and tutorials on how to move your WordPress installation for all manner of user levels. They range from the basic to the detailed or for more advanced users.

But one thing these guides have failed to mention if you use the built-in upload facility – watch your absolute server paths.

What the frak is an “Absolute Server Path”

The absolute server path is the full path to a file or folder. More about paths. For example a jpeg file name “just-a-picture.jpg” is stored here: wp-content/uploads/just-a-picture.jpg.

The absolute server path could look like this:

/home/username/public_html/wp-content/uploads/2007/03/just-a-picture.jpg

This value is what WordPress saves every time you upload an attachment inside the following post meta keys:

  • _wp_attached_file
  • _wp_attachment_metadata

While this doesn’t really affect what you see on your website, it does affect the uploads admin page. Instead of seeing a thumbnail, you’ll see the full image.
And unless you want to upload all the images again, then you’re screwed.

Okay so I am exaggerating. You just have a bit more work to do.

So what do I do?

Before transferring your database over to your new server, open your database backup in a text editor and change all instances of the old server path to the new one with the search facility.

Or you could use the tool mentioned here to do a global search and replace for the absolute server paths.

I ended up making a plugin to help fix 1000+ attachments for my friend’s website. With better than dial-up internet speed, it took about a minute each to fix thumbnails and attachments.

So I’m releasing the Fix Attachments plugin for use as a last resort in case the two options I mentioned above don’t work for you.

Remember, have an unaltered backup of your database handy in case anything goes wrong. The plugin worked fine in my case but it may not work in yours and you WILL want to restore your database.

In a mood

The WordPress Codex lists some plugins for adding moods to posts

Moody: Enter your mood in the Custom Field section of your post entry and the plugin will display in your theme below the time.
Sounds good but the plugin doesn’t work with WordPress 2.0 and up. Plus you have to do your configuration in the php file.

Mood Quote: Let’s you assign a quote for your mood. Interesting plugin though it’s not what I need.

Cricket Moods: This plugin lets you assign moods with images so whenever you put a mood in your entry. What’s good about this plugin is that each user can customize their own mood list and you have the option to automatically show the mood or position it in your template.

MyMooMus: This is a three-for-one plugin, combining the display of moods, music and tv in your posts. However it only shows the text not images.

I’ve made my own plugin that lets you set the location of your mood directory and image extension. In the Write Post screen, select a mood from the drop-down list of moods. There’s also a template tag to display the mood in your template. It’s not available to the general public because I’m still testing and adding features but if you’d like to try it out, drop me a line and I’ll send you the file.

LJ-fying Your Blog – The LJ Cut

I’ve had my Livejournal account for at least 5 years but until a year ago I was only using it to catch up with friends who had journals there.

But since I’ve discovered icon-making, I’ve become quite versed in using LJ and I’d like to have similar functionality on my blog as well.

One such function is The LJ Cut which lets you hide various blocks of text from view on the main page. This is incredibly useful if you have spoilers

In WordPress the closest we get is the <!–more–> tag which makes all succeeding text visible on the individual page entry.


To achieve the LJ Cut with WordPress, I use Scott Riley’s Hide or Cut Post Text Plugin.

The basic option is:
<!–cut–> All my text goes here <!–/cut–>

To put a custom text link you just use:
<!–cut=what other text to put–> Even more text <!–/cut–>

How easy is that?! With a few tags I can cut text, hide text and do other nifty things!

The Quest for Userpics Continues

I’m trying to get Livejournal functionality here and one of the main features I’d like to have is userpics.

In LJ they’re used to identify the theme of an entry and I’d like to do the same here. Since I have free account I only have 6 userpics but I figure if I can have that feature here, the number of userpics I can have is unlimited!

I tried the Post Image plugin which works in tandem with WordPress’s upload capability. But this meant I would have to upload a picture for every time I made a new post. Not good since I would like to re-use certain images from time to time.

Next I tried just placing in the link to the image in the Custom Fields section of the Write Post screen but I have difficulty remembering the image names and I spent too much time checking on the different pictures.

I could have used Category Icons but this is pretty much like having 6 userpics only.

The closest plugin I could find was Multi Topic Icon but I found it cumbersome to use especially in terms of positioning the image.

So I decided to make my own plugin, Post Avatar, my first by the way.

The way it works is you upload your images to a specified folder and each time you make a post, you have a list of images to choose from. There’s also a template tag that you can place in your theme to display the picture.

I’m really pleased with the way it turned out. *Go Team ME*. In the future I’ll be adding an image preview so I know what image I’m attaching to my post.

So I decided to create a plugin that would display a list of images I had already uploaded, for me to select when adding a post.

"Sidebar" Widgets

I’ve been playing around with widgets and they’re fantastic – you can drag and drop stuff that you want to appear in your sidebar without having to go into your themes to edit the html or wordpress tags.

This is great for theme designers who want to give users more functionality on the content that they want to display.

But why relegate your widgets to the sidebar only?

You can potentially use them everywhere! Right now my “listening to” and search modules are widgetized. Change your css and update your functions.php file to allow multiple sidebars and your options are endless!

Integrating WordPress and FanAdmin Plus

Integrating WordPress with FanAdmin Plus

Here’s a tutorial to help you integrate WordPress with FanAdmin Plus as I did for the Ben Affleck fanlisting and weblog. I may make other tutorials for the other types of fanlisting scripts later on. This tutorial assumes that you know your way around both WordPress and FanAdmin Plus. So let’s get started!

What you’ll need:

WordPress as a CMS

Could you run a website using WordPress?

I’ve been thinking about that and a few weeks ago I got a chance to put that thought into practice when Pia launched the beta of FanAdmin Plus

With a bit of organization, customization and add-ons it’s easy to turn a blog tool into a content management system.

Organizing Content
This was the first thing I had to consider: what will I need the site to do? what type of content will I have? Basically I want the FanAdmin Plus site to :

  • document the script with explainations and how-tos;
  • provide screenshots;
  • track problems and feature requests;
  • let people keep in touch with Pia and me;
  • allow people to download the script (eventually)

Main MenuA great thing about WordPress is the ability to organize content by entries and pages. This way I can mix up my content – general information, bug tracking, feature requests while using the entries for the actual documentation and site updates. So now, each link in the main menu is a link to a WordPress page.

Add-Ons
A powerful feature of WordPress is that you can easily set up plugins to extend the functionality of your blog.

We wanted to have a gallery of screenshots of the script so visitors can get a feel for what to expect. I’m using Hivework’s Gallery Manager plugin to organize screen shots.

In Series Plugin Even though posts are organized by categories I wanted link together a particular set of tutorials. For that I used In Series which bills itself as “easy, future-proof way to connect a series of posts”. As the figure shows, I can group together posts under different headings even if they are in the same category.

By default, WordPress displays the most recent entries from all categories on the main page. I only want to show posts from the “Site Updates” category so I used Front Page Categories

And for a contact form I used In Touch plugin. What I like about this plugin is that I can put a contact form anywhere I want, on a page or in a post!

Later on I’m going to put in download monitor plugin to keep track of the number of times the script is being downloaded. But that’s for the future, once we work out all the kinks and bugs in the script.

Customizing Layouts
This is another thing I love about WordPress, the themes! Setting up a theme simply involves uploading the necessary files and activating the theme.

But since we didn’t want a canned look for the site, I customized the Kubrick theme to match the look of the FanAdmin Plus script.