WordPress 2

Blog posts are normally organized by category. This enables readers to find content by topic. A post's categories usually appear at the beginning or end of the post and most WordPress themes include a category list in the blog's navigation sidebar (Figure 1).

Figure 1. Our sample blog, which uses the Default theme in this illustration, includes the category name at the end of the post and a list of categories in the sidebar.

WordPress enables you to create as many categories as you like. Categories can have long or short names and can even have subcategories (Figure 2).

Figure 2. One of Maria's projects, wickenburg-az.com, has a complex system of categories and subcategories.

In this part of the chapter, we explain how to create, modify, and remove categories and subcategories for your WordPress blog. You do all this with the Categories administration panel (Figure 3).

Tips

  • In most themes, a category will only appear in the sidebar's category list if there is at least one post in it.

  • WordPress.com accounts use post categories to organize links or bookmarks. This is a relatively recent change to WordPress.com and marks a departure from how links are organized on WordPress server installations.

To display the Categories administration panel

1.

If necessary, log into your blog and display the Dashboard.

2.

Click the Manage button.

3.

Click the Categories button in the second row of buttons. The Categories administration panel appears (Figure 3a or 3b).

Figures 3a & 3b. The Categories administration panel lists all defined categories and includes a form for creating new ones. On a WordPress.com blog (top), categories are used for both posts and bookmarks, while on a WordPress server-installed blog (bottom), categories are just used for posts.

Tips

  • As shown in Figures 3a and 3b, there are minor differences between the way the Categories administration panel appears for a WordPress.com blog (Figure 3a) and a WordPress server-installed blog (Figure 3b). The administration panel has the same basic functionality for either setup.

  • A WordPress.com blog has two default categories: Feeds and Uncategorized. Feeds is the default category for bookmarks; Uncategorized is the default category for posts.

To add a category or subcategory

1.

Open the Categories administration panel (Figure 3).

2.

Click the add new link or scroll down to the Add New Category area.

3.

Enter the following information for the category:

  • Name is the name of the category.

  • Category parent is a higher-level category for the category. To create a subcategory, choose another category from this drop-down list. The list will include all categories and subcategories already defined (Figure 4). You can leave this option set to None if you don't want the category to be a subcategory.

    Figure 4. To create a subcategory, choose a category from the Category parent drop-down list. This example shows the category/subcategory structure on the site illustrated in Figure 2.

  • Description is an optional description for the category. The text you enter here appears in most Web browsers when the visitor points to a category link (Figure 5). It's a good idea to keep this description short, even though WordPress gives you a big text box.

    Figure 5. Pointing to a category link in your blog displays the category's description.

4.

Click Add Category. The category is added to the list near the top of the window (Figure 6).

Figure 6. The category list after adding four categories and two subcategories.

Tips

  • On a server installation of WordPress, categories are assigned unique numeric IDs in the order in which they were created. On a WordPress.com blog, category IDs are assigned based on existing categories in other WordPress.com blogs, so the numbers will be out of sequence.

  • When you create a subcategory, it appears indented under its parent category in the Categories list (Figure 6).

To edit a category

1.

Open the Categories administration panel (Figure 6).

2.

Click the Edit link beside the category you want to edit. The Edit Category administration panel appears (Figure 7).

Figure 7. The Edit Category administration panel enables you to change options for a category.

3.

Change settings as desired:

  • Category name is the name of the category.

  • Category slug is a short name for the category that is used in permalinks. This option does not appear in the Edit Category administration panel for a WordPress.com blog.

  • Category parent is a subcategory's parent category.

  • Description is a brief description of the category.

4.

Click Edit category to save your changes.

Tips

  • We tell you about permalinks in Chapter 2.

  • To change a category into a subcategory, choose another category from the Category parent drop-down list (Figure 4).

  • To change a subcategory into a category, choose None from the Category parent drop-down list (Figure 4).

To remove a category

1.

Open the Categories administration panel (Figure 6).

2.

Click the Delete link beside the category you want to remove.

3.

If the category contains posts or bookmarks, a warning dialog like the one in Figure 8 appears. To delete the category, click OK.

Figure 8. When you delete a category that has posts or bookmarks assigned to it, a confirmation dialog like this appears.

The category is removed from the category list.

Tips

  • You cannot delete the default categories. The default post category is normally named Uncategorized (Figure 6), unless you change it as shown in Figure 9. The default bookmarks category for WordPress.com blogs is Feeds (Figure 3a).

    Figure 9. In this example, we changed the Uncategorized category to Unfiled and gave it a description.

  • Deleting a category does not delete any post or bookmark assigned to that category.

  • When you delete a category, any post or bookmark with that category assigned is reassigned to the corresponding default category.

  • When you delete a parent category, all of its subcategories are "promoted" from subcategory to category.

  • In a WordPress server installation, category IDs are not reused. If you delete a category, it's ID is automatically "retired" and won't be used againeven if you create a new category with the same name.

Категории