Tagged WordPress

WordPress Plugin: Category Converter

Designed by the Armenian Eagle (Armenio to his friends), Category Converter is the only plugin you’ll ever need to keep your blog categories perfectly organized. This is pretty much the simplest and downright fastest way to convert categories in the popular WordPress blogging software. Not only does it allow you to move stories from one category to another, it also helps you easily reduce and combine existing categories that you may no longer need. Plus, it’s fast. Very. Fast.

read more | digg story
wordpress, plugin, wordpress plugin, category converter, convert categories, blog

Editing WordPress QuickTags to automatically create captioned images

Filler Bunny: He takes up space
Filler Bunny

One of the best ways to add life to your blog posts is to include images with the text–your reader’s eye is naturally drawn to the large visual well before the text itself, and the addition of a picture can bring an element or realism to your post that would normally be missed. Many templates available on the web, however, fail to include a simple way to add captions to your images, limiting what you can do with them. For example, anyone posting a picture of, say, two dogs would be hard-pressed to indicate which was Rover and which Fido without the aid of a caption. The easiest solution is to place the image in a table with a caption, of course, but this adds several ungainly lines of code which you must type in by hand in order to add a single captioned image. Even copying and pasting, this method of posting captioned images is a serious pain at best.

Thanks to WordPressQuickTags (the row of buttons directly above the post content itself on the Write page), however, it’s relatively simple to edit the ‘img’ button to create custom captioned images.

First, replace the function edInsertImage in /wp-includes/js/quicktags.js with the following javascript:

function edInsertImage(myField) {
var myValue = prompt(‘Enter the URL of the image’, ‘http://’);
if (myValue) {
myValue = ‘<img src="’
+ myValue
+ ‘" alt="’ + prompt(‘Enter a description of the image’, ”)
+ ‘" />’;
myValue = ‘<table class="alignright" width="’
+ prompt(‘Enter the image width’, ‘250’)
+ ‘" border="’
+ prompt(‘Border size:’, ‘0’)
+ ‘" cellspacing="0" cellpadding="0">’
+ ‘<caption align="bottom"><b>’
+ prompt(‘Caption:’, ”)
+ ‘</b></caption><tr><td>’
+ myValue
+ ‘</tr></td></table>’;
edInsertContent(myField, myValue);
}
}

Now, at this point, once you’ve replaced your current quicktags.js, the ‘img’ button on the write page may or may not do what you want it to do. Chances are that you’ll have to add to your CSS as well before you can reap the benefits of the modified ‘img’ button, though. If so, place the following in your template’s CSS sheet:

table.alignright {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}

table.alignleft {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}

That should do it. Now whenever you go to add an image with the quicktags img button, it will prompt you for all the appropriate parameters to create a nicely captioned image like the one above. Should you wish, you can add other elements to the javascript, such as the ability to choose the color of the photo’s border.

UPDATE: Make sure you refresh the ‘Write Post’ page of WordPress after you modifiy your quicktags.js file. Otherwise, the cached (unmodified) version will continue to be used.

WordPress Widgets now available for download

The WordPress development team announced the release of the new Widgets feature today. The idea behind these Widgets is apparently that they allow you to edit your blog’s formatting and design (in this case the sidebar) through a GUI, eliminating the need for coding knowledge. Although I’m a bit afraid that, like the WYSIWYG editor which made its way into WordPress 2.0, the new Widgets might prove more cumbersome than helpful, I also think it’s important to look at the big picture of blogging as it exists today. There are hundreds of thousands of people out there with excellent blog content and the crappiest looking template imaginable, because they lack the knowledge to edit the source code directly. This tool will help them incorporate the little additions and gadgets that make the blogging experience enjoyable for the reader, without forcing them to spend countless hours debugging changes on multiple browsers and multiple OS’s. Additionally, since WordPress claims that writing Widgets should be as easy as writing plugins, the open source world should soon be contributing a plethora of them to match the output of plugins that we currently see. I know that it’s popular to hate things like this within the IT community, where obscure wisdom is prized as a status symbol, and the general attitude is ‘if you can’t do it the hard way, you’re not worthy of doing it at all,’ but if Widgets can help expand the two-way communication that thrives on blogs, more power to ’em.