Chapter 5
IN THIS CHAPTER
Setting up categories
Exploring permalinks
Discovering RSS options
Writing and editing posts and pages
Managing and moderating comments
WordPress is a powerful publishing tool, especially when you use the full range of options available. With the basic settings configured (which I show you how to do in Chapter 4), now is the time to go forth and publish! You can skip to the “Writing Your First Entry” section in this chapter and jump right into creating new posts for your website. Or you can stay right here and discover some of the options you can set to make your website a bit more organized and logical from the get-go.
In WordPress, a category is what you determine to be the main topic of an individual piece of content on your site. Through the use of categories, you can file your posts into topics by subject. To improve your readers’ experiences in navigating your site, WordPress organizes posts by the categories you assign to them. Visitors can click the categories they’re interested in to see the posts you’ve written on those particular topics.
You should know ahead of time that the list of categories you set up is displayed on your site in a few places, including the following:
Filed In:
Category 1
,
Category 2
. The reader can click the category name to go to a page that lists all the posts you’ve made in that particular category. You can assign a single post to more than one category.Subcategories (also known as category children) can further refine the main category topic by listing specific topics related to the main (parent) category. In your WordPress Dashboard, on the Manage Categories page, subcategories are listed directly below the main category. Here’s an example:
Upon installation, WordPress gives you one default category to get you started: Uncategorized. (See the Categories screen shown in Figure 5-1.) That category name is pretty generic, so you’ll definitely want to change it to one that’s more specific to you. (On my site, I changed it to Life in General. Although that name’s still a bit on the generic side, it doesn’t sound quite so…well, uncategorized.)
FIGURE 5-1: The Categories screen of a brand-new site shows the default Uncategorized category.
So how do you change the name of that default category? When you’re logged in to your WordPress Dashboard, just follow these steps:
Click the Categories link on the Posts submenu of the Dashboard navigation menu.
The Categories screen opens, containing all the tools you need to set up and edit category titles for your site.
Click the title of the category you want to edit.
If you want to change the Uncategorized category, click the word Uncategorized to open the Edit Category screen (see Figure 5-2).
Type the new slug in the Slug text box.
The term slug refers to the word(s) used in the web address for the specific category. The category Books, for example, has a web address of http://
yourdomain
.com/category/books
. If you change the slug to Books I Like, the web address is http://
yourdomain
.com/category/books-i-like
. (WordPress automatically inserts hyphens between the slug words in the web address.)
Choose a parent category from the Parent drop-down menu.
If you want this category to be a main category, not a subcategory, choose None.
(Optional) Type a description of the category in the Description text box.
Use this description to remind yourself what your category is about. Some WordPress themes display the category description right on your site, too, which can be helpful for your visitors. (See Chapter 9 for more about themes.) You’ll know that your theme is coded in this way if your site displays the category description on the category page(s).
Click the Update button.
The information you just edited is saved, and the Categories screen reloads, showing your new category name.
FIGURE 5-2: Editing a category in the Edit Category screen.
Today, tomorrow, next month, next year — as your website grows in size and age, you’ll continue adding new categories to further define and archive the history of your posts. You aren’t limited in the number of categories and subcategories you can create.
Creating a new category is as easy as following these steps:
Click the Categories link on the Posts submenu of the Dashboard navigation menu.
The Categories screen opens, displaying the Add New Category section on the left side (see Figure 5-3).
Type the name of your new category in the Name text box.
If you want to create a category in which you file all your posts about the books you read, for example, you might type Books I Enjoy.
Type a name in the Slug text box.
The slug creates the link to the category page that lists all the posts you’ve made in this category. If you leave this field blank, WordPress automatically creates a slug based on the category name. If the category is Books I Enjoy, WordPress automatically creates a category slug like this: http://
yourdomain
.com/category/books-i-enjoy
. If you want to shorten it, you can. Type books in the category Slug text box, and the link to the category becomes http://
yourdomain
.com/category/books
.
Choose the category’s parent from the Parent Category drop-down menu.
Choose None if you want this new category to be a parent (or top-level) category. If you’d like this category to be a subcategory of another category, choose the category you want to be the parent of this one.
(Optional) Type a description of the category in the Description text box.
Some WordPress templates are set up to display the category description directly below the category name (see Chapter 9). Providing a description helps you further define the category intent for your readers. The description can be as short or as long as you like.
Click the Add New Category button.
That’s it! You’ve added a new category to your blog. Armed with this information, you can add an unlimited number of categories to your new site.
FIGURE 5-3: Create a new category for your website.
You can delete a category by hovering your mouse over the title of the category you want to delete and then clicking the Delete link that appears below the title.
Each WordPress post and page is assigned its own web page, and the address (or URL) of that page is called a permalink. Posts that you see in WordPress sites usually put their permalinks in any of four areas:
Permalinks are meant to be permanent links to your blog posts (which is where the perma part of that word comes from, in case you’re wondering). Ideally, the permalink of a post never changes. WordPress creates the permalink automatically when you publish a new post.
By default, a permalink in WordPress looks like this:
http://yourdomain.com/?p=100/
The p
stands for post, and 100
is the ID assigned to the individual post. You can leave the permalinks in this format if you don’t mind letting WordPress associate each post with an ID number.
WordPress, however, lets you take your permalinks to the beauty salon for a bit of a makeover. I’ll bet you didn’t know that permalinks could be pretty, did you? They certainly can. Allow me to explain.
Pretty permalinks are links that are more pleasing to the eye than standard links and, ultimately, more pleasing to search-engine spiders. (See Chapter 12 for an explanation of why search engines like pretty permalinks.) Pretty permalinks look something like this:
http://yourdomain.com/2017/03/20/pretty-permalinks/
Break down that URL, and you see the date when the post was made, in year/month/day format. You also see the topic of the post.
To choose how your permalinks look, click Permalinks on the Settings menu. The Permalink Settings screen opens, as shown in Figure 5-4.
FIGURE 5-4: Make your permalinks pretty.
On this screen, you find several options for creating permalinks:
http://
yourdomain
.com/?p=123
.http://
yourdomain
.com/2017/03/20/sample-post/
.http://
yourdomain
.com/2017/03/sample-post/
.http://
yourdomain
.com/archives/123
.http://lisasabin-wilson.com/books
. Likewise, a post titled WordPress Is Awesome gets a permalink URL like this: http://lisasabin-wilson.com/wordpress-is-awesome
.To create a pretty-permalink structure, select the Post Name radio button; then click the Save Changes button at the bottom of the page.
A custom permalink structure is one that lets you define which variables you want to see in your permalinks by using the tags listed in Table 5-1.
TABLE 5-1 Custom Permalinks
Permalink Tag |
Results |
|
4-digit year (such as |
|
2-digit month (such as |
|
2-digit day (such as |
|
2-digit hour of the day (such as |
|
2-digit minute (such as |
|
2-digit second (such as |
|
Text — usually, the post name — separated by hyphens (such as |
|
The unique numerical ID of the post (such as |
|
The text of the category name that you filed the post in (such as |
|
The text of the post author’s name (such as |
If you want your permalink to show the year, month, day, category, and post name, select the Custom Structure radio button in the Permalink Settings page, and type the following tags in the Custom Structure text box:
/%year%/%monthnum%/%day%/%category%/%postname%/
If you use this permalink format, a link for a post made on March 20, 2017, called WordPress For Dummies and filed in the Books I Read category, would look like this:
http://yourdomain.com/2017/03/20/books-i-read/wordpress-for-dummies/
Don’t forget to click the Save Changes button at the bottom of the Permalink Settings page; otherwise, your permalink changes won’t be saved!
After you set the format for the permalinks for your site by using any options other than the default, WordPress writes specific rules, or directives, to the .htaccess
file on your web server. The .htaccess
file in turn communicates to your web server how it should serve up the permalinks, according to the permalink structure you’ve chosen to use. To use an .htaccess
file, you need to know the answers to two questions:
.htaccess
file?mod_rewrite
module?If you don’t know the answers, contact your hosting provider to find out.
If the answer to both questions is yes, continue with the following steps. If the answer is no to both questions, skip to the sidebar “Working with servers that don’t use Apache mod_rewrite” later in this chapter.
You and WordPress work together in glorious harmony to create the .htaccess
file that lets you use a pretty-permalink structure on your website. The file works like this:
Locate the .htaccess
file on your web server, or create one and put it there.
If
.htaccess
already exists, you can find it in the root of your directory on your web server — that is, the same directory where you find your wp-config.php
file. If you don’t see the file in the root directory, try changing the options of your SFTP (Secure File Transfer Protocol) client to show hidden files. Because the .htaccess
file starts with a period (.
), it may not be visible until you configure your SFTP client to show hidden files.
If you need to create the file and put it on your web server, follow these steps:
htaccess.txt
.htaccess.txt
to your web server via SFTP. (See Chapter 3 for more information about SFTP.).htaccess
(notice the period at the beginning), and make sure that it’s writable by the server by changing permissions to 755 or 777. (See Chapter 3 for information on changing permissions on server files.)Click the Save Changes button at the bottom of the Permalink Settings screen.
WordPress inserts into the .htaccess
file the specific rules necessary for making the permalink structure functional in your blog.
If you followed these steps correctly, you have an .htaccess
file on your web server that has the correct permissions set so that WordPress can write the correct rules to it. Your pretty-permalink structure works flawlessly. Kudos!
If you open the .htaccess
file and look at it now, you see that it’s no longer blank. It should contain code called rewrite rules, which looks something like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
In Chapter 2, you can read about RSS feed technology and why it’s an important part of publishing content on the Internet. Allow me to quote myself from that chapter: For your readers to stay updated with the latest and greatest content you post to your site, they need to subscribe to your RSS feed.
RSS feeds come in different flavors, including RSS 0.92, RDF/RSS 1.0, RSS 2.0, and Atom. The differences lie within the base code that makes up the functionality of the syndication feed. What’s important is that WordPress supports all versions of RSS — which means that anyone can subscribe to your RSS feed with any type of feed reader available.
I mention many times throughout this book that WordPress is very intuitive, and this section on RSS feeds is a shining example of a feature that WordPress automates. WordPress has a built-in feed generator that works behind the scenes to create feeds for you. This feed generator creates feeds from your posts, comments, and even categories.
The RSS feed for your posts is autodiscoverable, which means that almost all RSS feed readers and most browsers (Firefox, Chrome, Internet Explorer, and Safari, for example) automatically detect the RSS feed URL for a WordPress blog. Table 5-2 gives you some good guidelines on how to find the RSS feed URLs for the different sections of your site.
TABLE 5-2 URLs for Built-In WordPress Feeds
Feed Type |
Example Feed URL |
RSS 0.92 |
|
RDF/RSS 1.0 |
|
RSS 2.0 |
|
Atom |
|
Comments RSS |
|
Category RSS |
|
http://
yourdomain
.com/feed
— your main RSS feedhttp://yourdomain.com/comments/feed
— your comments RSS feedhttp://yourdomain.com/category/cat-name/feed
— RSS feed for a categoryTry this technique with any URL on your site. Add /feed
at the end, and you’ll have the RSS feed for that page.
RSS feeds are important parts of delivering content from your blog to your readers. RSS feeds are expected these days, so the fact that WordPress takes care of everything for you — provides the feeds for you, complies with all RSS formats, and offers many internal feeds — gives the software a huge advantage over any other content management system.
It’s finally time to write your first post on your new WordPress site! The topic you choose to write about and the writing techniques you use to get your message across are all on you; I have my hands full writing this book! I can tell you, however, how to write the wonderful passages that can bring you blog fame. Ready?
Composing a post is a lot like typing an email: You give it a title, you write the message, and you click a button to send your words into the world.
Follow these steps to write a basic post:
Click the Add New link on the Posts menu of the Dashboard.
The Add New Post screen opens, as shown in Figure 5-5.
Type the content of your post in the text box.
You can use the Visual Text Editor to format the text in your post. I explain the Visual Text Editor and the buttons and options after these steps.
Click the Save Draft button in the Publish module, located in the top-right corner of the Add New Post screen.
The screen refreshes with your post title and content saved but not yet published to your site.
FIGURE 5-5: This page is where you give your post a title and write your post body.
By default, the area in which you write your post is in Visual Editing mode, as indicated by the Visual tab that appears above the text. Visual Editing mode is how WordPress provides WYSIWYG (What You See Is What You Get) options for formatting. Rather than embed HTML code in your post, you can simply type your post, highlight the text you want to format, and click the buttons (shown in Figure 5-5) that appear above the text box.
If you’ve ever used a word processing program, such as Microsoft Word, you’ll recognize many of these buttons, which are on the top row of the toolbar and are listed in order from left to right:
<p> </p>
HTML tags around the text to indicate paragraph breaks.<H1> </H1>
around text to indicate HTML headings. H1 defines the largest, and H6 defines the smallest. Heading formats are usually defined in CSS (Cascading Style Sheets; see Chapter 10) with font size and/or colors.<pre> </pre>
HTML tags around the text to indicate preformatted text, and preserves both spaces and line breaks.<strong> </strong>
HTML tag to emphasize the text in bold (example: Bold Text).<em> </em>
HTML tag to emphasize the text in italics (example: Italic Text).<ul><li> </li></ul>
HTML tags that create an unordered (bulleted) list.<ol><li> </li></ol>
HTML tags that create an ordered (numbered) list.<blockquote> </blockquote>
HTML tag that indents the paragraph or section of text you’ve selected.<p align=" left"> </p>
HTML tag that lines up the selected text against the left margin.<p align=" center"> </p>
HTML tag that positions the selected text in the center of the page.<p align=" right"> </p>
HTML tag that lines up the selected text against the right margin.<a href=" " > </a>
HTML tag around the text you’ve selected to create a hyperlink.<!--more-->
tag, which lets you split the display on your blog page, and publishes the text written above this tag with a Read More link, which takes the user to a page with the full post. This feature is good for really long posts.<strike> </strike>
HTML tag that puts a line through your text (example: Strikethrough Text).<hr> </hr>
HTML tag that puts a horizontal line in your content.You can turn off the Visual Text Editor by clicking the Your Profile link on the Users menu. Deselect the Use the Visual Editor When Writing check box to turn off this editor if you’d rather manually insert the HTML code into your posts.
At this point, you can skip to “Publishing your post” later in this chapter for information on publishing your post to your site, or continue with the following sections to discover how to refine the options for your post.
Directly above and to the left of the Visual Text Editor row of buttons is an Add Media area, with a row of four icons. These icons let you insert images/photos, photo galleries, videos, and audio files into your posts. WordPress has an entire Media Library capability, which I describe in detail in Chapter 6.
After you write the post, you can choose a few extra options before you publish it for the entire world to see. By default, the Add New Post screen of the WordPress Dashboard displays only a few options, because they’re the minimum options you need to publish a post. You can find these options below the post text box (see Figure 5-6). Click the title of each option, and the settings for that specific option expand.
FIGURE 5-6: Several options are available for your blog post.
If you don’t see these options on the Add New Post page of your Dashboard, you most likely haven’t enabled them in Screen Options (discussed in Chapter 4). Click the Screen Options tab at the top of the Add New Post page, and enable the modules that you’d like to use.
Here are the options below the post text box:
http://
domain.com
/wordpress-tips
. The Slug options allow you to set a different slug for your post (or page) from the one WordPress automatically creates for you. You could shorten the slug for the post titled WordPress Tips to wordpress
so that the URL for the post becomes http://
domain.com
/wordpress
.These optional modules in the preceding list apply to the post you’re currently working on — not to any future or past posts. You can find these options below the Post text box after they’re activated in Screen Options. Click the title of each option to make the settings for that specific option expand or collapse.
Cats, Kittens, Felines
represent three different tags, for example, but without the commas, WordPress would consider those three words to be one tag. Click the Add button to add the tags to your post. (For more information on tags, refer to the sidebar “What are tags, and how/why do I use them?” earlier in this chapter.)You’ve given your new post a title and written the content of your new post. Maybe you’ve even added an image or other type of media file to your blog post (see Chapter 6) and configured the tags, categories, and other options. Now the question is whether to publish — or not publish (yet).
WordPress gives you three options for saving or publishing your post when you’re done writing it. The Publish module is located on the right side of the Add New (or Edit) Post screen. Just click the title of the Publish module (see Figure 5-7) to display the settings you need.
FIGURE 5-7: The Publish module.
The Publish module has several options:
Status: Click the Edit link to open the settings for this option. A drop-down menu appears, from which you can choose one of these options:
Click OK to save your settings.
Public: Select this option to make the post viewable by everyone who visits your site. Select the check box titled Stick This Post to the Front Page to have WordPress publish the post on your site and keep it at the top of all posts until you change this setting for the post.
This option is otherwise known as a sticky post. Typically, posts are displayed in chronological order on your site, with the most recent post displayed at the top. If you make a post sticky, it remains at the top no matter how many other posts you make after it. When you want to unstick the post, deselect the Stick This Post to the Front Page check box.
Publish Immediately: Click the Edit link to make the publish-date options appear, and set the time stamp for your post. If you want the post to have the current time and date, ignore this setting.
If you want to future-publish this post, you can set the time and date for anytime in the future. If you have a vacation planned and don’t want your site to go without updates while you’re gone, for example, you can write a few posts and set the date for a time in the future. Those posts are published to your site while you’re somewhere tropical, diving with the fishes.
After you choose an option from the drop-down menu, click the Save button. The Add New Post screen saves your publishing-status option.
While I write this book, I have editors and proofreaders looking over my shoulder, making recommendations, correcting my typos and grammatical errors, and helping me by telling me when I get too long-winded.
You, on the other hand, aren’t so lucky! You’re your own editor and have full control of what you write, when you write it, and how you write it. You can always go back and edit posts to correct typos, grammatical errors, and other mistakes by following these steps:
Find the post that you want to edit by clicking the All Posts link on the Posts menu.
The Posts screen opens, listing the 20 most recent posts you’ve made to your site.
To filter that listing of posts by date, choose a date from the All Dates drop-down menu at the top of the Posts screen (Dashboard ⇒ Posts). If you choose March 2017, the Posts page reloads, displaying only those posts that were published in March 2017.
You can also filter the post listing by category. Choose your desired category from the All Categories drop-down menu.
When you find the post you need, click its title.
Alternatively, click the Edit link that appears below the post title.
The Edit Post screen opens. In this screen, you can edit the post and/or any of its options.
If you need to edit only the post options, click the Quick Edit link. The post options open, and you can configure post options such as the title, status, password, categories, tags, comments, and time stamp. Click the Save button to save your changes without ever leaving the Post page of your Dashboard.
Edit your post; then click the Update button.
The Edit Post screen refreshes, with all your changes saved.
The feature that really catapulted blogging into the limelight is the comments feature, which lets visitors interact with the authors of sites. Comments and trackbacks are great ways for readers to interact with site owners, and vice versa. I cover both comments and trackbacks in Chapter 2.
To find your comments, click the Comments link on the Dashboard navigation menu. The Comments page opens (see Figure 5-8).
FIGURE 5-8: Clicking the Comments menu shows you the Comments page, with all the comments and trackbacks on your site.
When you hover your mouse pointer over your comments, several links appear that give you the opportunity to manage those comments:
FIGURE 5-9: Edit a user’s comment in the Edit Comment page.
If you have your options set so that comments aren’t published to your site until you approve them, you can approve comments from the Comments screen as well. Just click the Pending link on the Comments screen, and you go to the Edit Comments page. If you have comments and/or trackbacks awaiting moderation, you see them on this page, where you can approve them, mark them as spam, or delete them.
A nice feature of WordPress is that it immediately notifies you of any comments sitting in the moderation queue, awaiting your action. This notification appears as a small circle to the right of the Comments menu on the left navigation menu of every single page. Figure 5-10 shows my Dashboard page with an indicator in the Comments menu showing a comment awaiting moderation. (An indicator also appears on the top toolbar.)
FIGURE 5-10: These indicators tell me that I have a comment awaiting moderation.
I touch on Akismet a few times throughout this book because it’s my humble opinion that Akismet is the mother of all plugins and that no WordPress site is complete without a fully activated version of Akismet running on it.
Apparently, WordPress agrees, because the plugin has been packaged in every WordPress software release beginning with version 2.0. Akismet was created by the folks at Automattic.
I’ve been blogging since 2002 when I started blogging with the Movable Type blogging platform. I moved to WordPress in 2003. As blogging became more and more popular, comment and trackback spam became more and more of a nuisance. One morning in 2004, I found that 2,300 pieces of disgusting comment spam had been published to my blog. Something had to be done! The folks at Automattic did a fine thing with Akismet. Since the emergence of Akismet, I’ve barely had to think about comment or trackback spam except for the few times a month I check my Akismet spam queue.
I talk in greater detail about plugin use in WordPress in Chapter 7, where you find out how to activate Akismet and make sure that it’s protecting your blog from trackback and comment spam.