WordPress Complete(Sixth Edition)
上QQ阅读APP看书,第一时间看更新

Categories and tags

Categories and tags are two types of information that you can add to a blog post. We use them to organize the information in your blog by topic and content (rather than just by date) and to help visitors find what they are looking for on your blog.

Categories are primarily used for structural organizing. They can be hierarchical, meaning a category can be a parent of another category. A relatively busy blog will probably have at least 10 categories, but probably no more than 15 or 20. Each post in such a blog is likely to have between one and four categories assigned to it. For example, a blog about food and cooking might have these categories: Recipes, Food Talk, In The Media, Ingredients, and Restaurants. Of course, the numbers mentioned are just suggestions; you can create and assign as many categories as you like. The way you structure your categories is entirely up to you as well. There are no true rules regarding this in the WordPress world, just guidelines like these.

Tags are primarily used as shorthand for describing the topics covered in a particular blog post. A relatively busy blog will have anywhere from 15 to even 100 tags in use. Each post in that blog is likely to have three to ten tags assigned to it. For example, a post on a food blog about a recipe for butternut squash soup may have these tags: soup, vegetarian, autumn, hot, and easy. Again, you can create and assign as many tags as you like.

Let's add a new post to the blog. After you give it a title and some content, let's add tags and categories. When adding tags, just type your list of tags into the Tags box on the right-hand side of the interface, separated by commas:

Then, click on the Add button. The tags you just typed in will appear below the text field with little x buttons next to them. You can click on any x button to delete a tag. Once you've used some tags on your blog, you'll be able to click on the Choose from the most used tags link in this box so that you can easily reuse tags.

Categories work a bit differently than tags. Once you get your blog going, you'll usually just check the boxes next to existing categories in the Categories box. In this case, as we don't have any existing categories, we'll have to add one or two.

In the Categories box on the right, click on the + Add New Category link. Type your category into the text field, and click on the + Add New Category button. Your new category will show up on the list, already checked. Look at the following screenshot:

If, in the future you want to add a category that needs a parent category, select Parent category from the pull-down menu, before clicking on the + Add New Category button. If you want to manage more details about your categories, move them around, rename them, assign parent categories, and assign descriptive text, you can do so on the Categories page, which we'll see in detail later in this chapter.

Click on the Publish button, and you're done (you can instead choose to schedule a post; we'll explore that in detail in a few pages). When you look at the front page of your site, you'll see your new post on the top, your new category in the sidebar, and the tags and category (that you chose for your post) listed under the post itself.