Monday, October 22nd, 2007

upgrading to wordpress 2.3

This Was quite an easy upgrade really, and prompted me to split off my different website content stuff a bit differently.

The upgrade went as expected and so far doesn’t seem to have broken anything. The big win for me though is the new native tags feature. I’d tried messing about in previous releases with the categories, but tagging really does seem a bit of a better way to do it.

It took me a few minutes of google searching and looking around codex, but managed to find the code examples on making a “tag cloud”.

Basically you need to call the following function:

	wp_tag_cloud();

At it’s most basic, you can tell it the maximum size of the text for the entities that have been tagged least, and the maximum size for entities that have been tagged the most, so I use something like follows as the code for my sidebar:

	<p id="TagCloud">
	<?php wp_tag_cloud('smallest=8&largest=25'); ?>
	</p>

I just put this into the sidebar.php file under the current theme I’m using, and hey presto, I have a tag cloud in my sidebar!

You can also do nifty things like have a tag archive, so that whenever you go to http://www.thefraggle.com/tag/photography you can see a tag cloud at the top of the page, then the listing of the articles tagged with the selected tag.

All that was involved here was creating a file called tag.php in my themes directory, then filling this with the way I wanted the page to look, basically with a call to wp_tag_cloud() and a loop to display the tagged articles:

 ...
        <h2 class="storytitle">Search Content Through Tags</h2>
        <p id="TagCloud">
                <?php wp_tag_cloud(''); ?>
        </p>
        <div style='clear: both;'></div>
        <br /><br />
        <?php if (have_posts()) : ?>
                <?php while (have_posts()) : the_post(); ?>
                <h2><a href="<?php the_permalink() ?>"
            rel="bookmark" title="Permanent Link to<?php the_title(); ?>">
            <?php the_title(); ?></a></h2>

        <div class="entry">
                <?php the_content('Read the rest of this entry »'); ?>
            </div>
        <?php endwhile; ?>
        <?php endif; ?>
...

There’s more to my paticular tag.php file, as I have formatting things to make the page match the rest of the site and it’s template, but you get the gist :)

If you want to find out more information on the tagging features that wordpress-2.3 can do, then take a look at http://codex.wordpress.org/Template_Tags/wp_tag_cloud

There don’t seem to be a huge amount of plugins yet that help you manage your tags, but there is one that seems to do pretty much everything I think I would need to. It’s called “Simple Tags” and I found it via the all knowing Wordpress Plugin Directory, http://wordpress.org/extend/plugins/simple-tags/

There’s not a huge amount to say about it, but from there you can add and delete tags, mass edit the tags for posts and find untagged posts and pages.

Overall, I’d highly suggest to anyone that if you have the time to be bothered, and don’t have any plugins that might break due to the upgrade, get your upgrade on and get wordpress up to v2.3 :D

Suggestions and other ideas welcome on what else I can do with this nifty new feature :)

Tags: ,

» Filed under General Life by Chris Ganderton at 18:24.

back to top

Leave a comment







Credits and stuff

Copyright © [ t h e f r a g g l e . c o m ] | Powered by WP 2.3.1. | Tree by Headsetoptions and MandarinMusing a minimal theme based on HyperBallad Back to Content