WordPress 2.3 quietly introduced a powerful new feature that had previously only been available using plugins: tagging.
There are several ways to list your tags:
- Before or after each post, so people can click a tag to see other posts you’ve tagged the same way
- In a tag cloud in your sidebar
- On a tag archive page
I’ve found that tag archive pages are indexed very well by search engines, so I highly recommend using tags. But how should you use them, and how should they relate to WordPress categories?
As Lorelle said several years ago, tags are like a blog’s index, and categories are like the table of contents. Tags are great for SEO, but you don’t want to list a zillion of them in your sidebar; you want a concise list of categories.
It’s fine to have a zillion tags, but they’re better listed in a tag cloud or on an archive page. With that in mind, let’s look at how tags can become a part of your blog.
Listing the Tags for Each Post
Most WordPress themes have a post metadata section either before or after the body of the post, which includes the date, author, and comment link. This is a great place to display the tags for that post.
In this section, you can add
<?php the_tags('Tags: ', ', ', ' | '); ?>
to display a comma-separated list of the post’s tags, followed by a | mark. The parameters for this function are, respectively, what goes before the tags, what separates the tags, and what goes after the tags. Full documentation for this template tag (WP Codex)
Since tags are likely to make the post metadata section take up more than one line, make sure your theme still looks good if this section is several lines long; for example, some themes don’t leave enough linespacing because the theme author assumes it’ll only be one line long.
Since this tag applies to a specific post, it must be in the loop, not in the sidebar, header, or footer.
Listing Tags in a Sidebar Cloud
A tag cloud is a great way to visualize the topics you blog about, because the size of each tag is proportional to the number of times you’ve used it. This may not be immediately obvious on a new blog, but if you have 1,000 posts, and 800 of them are about horses and only 100 are about fish, the “horse” tag will be much bigger than the “fish” tag (assuming you’ve tagged your posts).
Here’s the function to display the tag cloud:
<?php wp_tag_cloud(''); ?>
You can put this tag in the sidebar or footer of your site, but don’t put it in the loop.
You can customize the minimum and maximum size of the items in the tag cloud, as well as how many to display and how to sort them. Full documentation for this template tag (WP Codex)
Displaying Tags on a Tag Archive Page
If you have tons of tags and you want to display them all in one place, but not on the main page of your blog, you can create a tag archive page. Here’s how.
- Make a copy of your single.php or index.php template, and name it something like “tag-archive.php”
- At the top of your tag archive template, insert this:
<?php
/*
Template Name: Tag Archive
*/
?>
- Replace everything from
<?php if (have_posts()) : ?>
to
<?php endif; ?>
(aka The Loop) with the <?php wp_tag_cloud(); ?> function. You can download a Kubrick-compatible tag archive template here.
- Upload the new template file tag-archive.php to your theme folder.
- Create a new page and call it something like “Tag Archives”. Under Page Template in the sidebar, select the new template you created. Leave the body of the page blank, and publish it.
- Make sure you link to the new page in your navbar or sidebar so people can find the tag archive page
Converting Categories to Tags
WordPress 2.3+ also has a category-to-tag converter, which you can use for categories that don’t have very many posts in them. To use it, go to Manage -> Import, and select Categories to Tags Converter.
The converter lists all of your categories and the number of posts in each. Select the categories you want to convert using the checkboxes, and hit Convert. This will add the tags and delete the categories you select, so be selective and don’t eliminate all of your categories.
Importing Plugin Tags to WordPress Tags
If you’ve been using a tagging plugin like Ultimate Tag Warrior or Bunny’s Technorati Tags, you can convert your tags to WordPress native tags (since they’re stored in a different place in the database). The converters (including the aforementioned category-to-tag converter) are listed in the WordPress admin panel under Manage -> Import.
Share This
One of the questions we get most often is how to enable WordPress to edit theme files using the built-in theme editor. By default, when you upload a theme, the files aren’t writable from the WordPress interface. This is based on the sensible assumption that, generally speaking, visitors to your website shouldn’t be able to edit the files on it. If you’re the administrator of your WordPress site, though, it’s very useful to use the built-in theme editor.
To make your theme files writable, you need to set the permissions on the theme files so WordPress can edit them. This process is also known as CHMOD, short for CHange MODe, which is a UNIX/Linux command (which you probably don’t need to worry about).
To change the permissions of the files on your site, the way you’d open a folder on your computer, you need an FTP application, which is a separate program that connects to the web server to let you upload, download, move, or rename files.
You can download an FTP program such as the following:
Smart FTP
CuteFTP
FireFTP (a Firefox extension, which may be the easiest if you use the Firefox browser; will not work if you don’t)
After installing one of these programs or another FTP application (there are tons available for free), login to your site via FTP. You’ll need three pieces of information:
FTP server - probably ftp.yourdomainname.com
Username - probably the same as your account webhosting account username
Password -probably the same as your account webhosting account password
Note that the username and password will not ordinarily be the same as your WordPress username and password.
Your files are probably within a folder called public_html, httpdocs, html or something along those lines. From there, the themes will be in /wp-content/themes/, and each theme is in its own folder.
Navigate to the folder containing your theme. Then, highlight all of the files in this folder and right-click on them. There should be an option on the FTP program’s right-click (context) menu called “CHMOD” or “Permissions.”
The permissions settings specify what can be done with a file, and by whom. They’re represented by numbers or checkboxes that give read/write/execute permissions for each file to various groups, e.g. website visitors, you (the FTP user), or the server administrator.
If the files are set to 000, only the server administrator will be able to access them. By default, most files uploaded via FTP are set to 755 or something similar, which means that WordPress can run because anyone can “execute” the file (that is, access the script). However, since WordPress is not considered a user, it’s a member of the “public” group, so by default it can’t write to files.
If you set the theme files to 777 (so everyone has “write” permissions as well as read and execute permissions), that will let you edit your theme from within WordPress. If your FTP program uses checkboxes instead of numbers for file permissions, just check all of them. If you change themes later, just re-do this for the new theme’s files. You could do this for all your files without any problem, but it would take a while, and it’s not really necessary.
Note that if you make an edit to a file that introduces an error that takes down your site, you might need to upload a fresh copy of the theme via FTP, so it’s best not to edit PHP portions of your theme unless you have a backup of the theme file or are comfortable editing PHP. The functions.php file should not be edited from within WordPress, as an error can take down the WP admin panel as well as the public site, and you’d need to fix the error via FTP.
This procedure will work for plugins as well using the built-in plugin editor, but editing plugins is much more likely to crash WordPress, so we do not recommend using the plugin editor. Most plugins have an options page now, and don’t require any editing. if you need to edit a file, use a text editor on your computer and upload the changed file via FTP. If you get an error, simply delete the file, fix the error, and upload it again.
To summarize:
- Download and install an FTP application
- Login to your site via FTP
- Navigate to the theme folder
- Select all the files, and right-click on them, and select “Permissions” or “CHMOD”
- Check all of the boxes or set the permissions to 777
- Visit Presentation -> Theme Editor in WordPress to edit your theme files
Share This
WebbleYou is proud to release the alpha edition of the LogoFriendly theme, which is in use on this site. This theme is highly customizable, and very easy to use. Read more
Share This
WebbleYou was commissioned by a client to widget-ize the excellent Blix theme for WordPress. You can download the widgetized version here: ZIP | tar.gz
WordPress widgets are a project of Automattic. The Widgets plugin requires WP2.0.2 (which we pre-install by default).
Notes:
- Blix was released for Version 1.5, but it works with WP2.0.x (which is required for using widgets).
- Blix uses different icons for different sidebar elements. If a sidebar element uses lists other than those specified in the stylesheet, they will be bulleted with the same icon used for categories. I think.
If you notice any issues, please let us know. If you would like WebbleYou to widget-ize a theme for you, we can do so for around $20 (depending on the complexity and your needs). Contact us to discuss details.
Note: This theme was last updated on May 1, 2006. If you downloaded the theme prior to that date, you will have RSS feed problems and other issues; please use the new version, which fixes these problems.
Share This
Posted in Themes on
Monday, December 5, 2005
The Radical Congruency 2005 theme was re-released today. Some new features in this release:
- Made center column’s width more consistent between Firefox and Internet Explorer; eliminated 20px gap on right side in Firefox
- Made post-title background image wider, to accomodate change in center column width
- Added min-height to blockquotes, so the
image doesn’t get cut off for one-line quotes. Also fixed some padding and margin issues with blockquotes
- Clicking on banner now takes you to current site’s home page (used to be hardcoded to RadicalCongruency.com)
- Blog description in page title now uses bloginfo tag, rather than being hardcoded
- Added JavaScript to search box, which clears contents so you can type without erasing “Search this site” manually. Also tweaked size of font and box.
- Made a few changes to footer (though you’ll still need to edit it to include your own copyright/Creative Commons notice and such)
- Moved sidebars into sidebar.php, for compliance with plugin API (sidebars were previously part of the footer)
- Added KICKIN’ JavaScript to convert post/comment timestamp to user’s local timezone (thanks, Aaron!)
Other features of this theme:
- Fills a 1024×768 screen perfectly, but doesn’t get unreasonably wide at higher resolutions (centered-magazine style)
- Center column is first in HTML, which improves search engine spidering and usability in alternative browsers and text readers
- Has alternating background images for comments
- Pre-formatted for CG-Amazon and Quicktags plugins
- Built-in Technorati links on each post
- Font size scales properly according to browser’s settings for greater accessibility
- It’s set up for use with great plugins, like Ultimate Tag Warrior - I even included the Ajax add-tag box
- All of the plugin calls are conditionalized, so if you deactivate one, it won’t break the site
- You can click on the banner to go to the home page (amazing how many themes leave that out)
- It’s the only theme in the world that displays post and comment time in the user’s timezone (thanks to Aaron’s fancy JavaScript)
Download here.
WebbleYou pre-installs and fully supports this theme, and we can also help you customize other themes to your liking.
Share This
Posted in Themes on
Wednesday, July 20, 2005
The Radical Congruency 2005 theme is now available for download. It’s a 1024×768 theme with three columns. The special feature of this theme is that the center column is first in the code, so your posts load first and are more visible to search engines and screen readers for the visually impaired. You can download the theme directly here.
Share This