Editing Pages
In WordPress, you can write either posts or pages. When you’re writing a regular blog entry, you write a post. Posts automatically appear in reverse chronological order on your blog’s home page. Pages, on the other hand, are for content such as “About Me,” “Contact Me,” etc.
Pages live outside of the normal blog chronology, and are often used to present information about yourself or your site that is somehow timeless — information that is always applicable. You can use Pages to organize and manage any amount of content.
Other examples of common pages include Copyright, Legal Information, Reprint Permissions, Company Information, and Accessibility Statement. (By the way, it’s a good idea to always have an about page and a contact page — see this advice from Lorelle.)
In general, Pages are very similar to Posts in that they both have Titles and Content and can use your site’s Presentation Templates to maintain a consistent look throughout your site. Pages, though, have several key distinctions that make them quite different from Posts.
Pages in a Nutshell
What Pages Are:
- Pages are for content that is less time-dependent than Posts.
- Pages can be organized into pages and SubPages.
- Pages can use different Page Templates which can include Template Files, Template Tags and other PHP code.
What Pages are Not:
- Pages are not Posts, nor are they excerpted from larger works of fiction. They do not cycle through your blog’s main page. (Note: You can include Posts in Pages by using the Inline Posts Plugin.)
- Pages cannot be associated with Categories and cannot be assigned Tags. The organizational structure for Pages comes only from their hierarchical interrelationships, and not from Tags or Categories.
- Pages are not files. They are stored in your database just like Posts are.
- Although you can put Template Tags and PHP code into a Page Template, you cannot put these into the content of a Page and expect them to run. (Note: You can achieve this by using a PHP evaluating Plugin such as Exec-PHP.)
Creating Pages
To create a new Page, log in to your WordPress installation with sufficient admin privileges to create new articles. Select the Administration > Pages > Add New option to begin writing a new Page.
Changing the URL (or “Slug”) of Your Pages
With 2.5, changing the page URL became less intuitive. If you have Permalinks enabled, and you have selected the Day and Name option (Click the Settings tab, and then click the Permalinks subtab), then the permalink automatically shows up below your post title when you start typing in the body of your post (not just the title).
However, if you have a different permalink option selected, or if you don’t have permalinks enabled at all, you must do the following to edit your page URL:
- Write a page by going to Pages > Add New.
- Click the Publish button to publish your page.
- Go to Pages > Edit.
- Click Edit under the name of your page.
- See the permalink under the title, and click the Edit link to change it.
Thus, if you don’t have the right permalink option enabled, you have to publish your pages before you can set the URLs.
Listing Your Pages on Your Site
WordPress is able to automatically generate a list of Pages on your site, for example within the sidebar, using a Template Tag called wp_list_pages(). See the wp_list_pages page for information on how to do the following:
- Sort the list of Pages (to fully customize the order in which the Pages are listed, you might find the “Page Order” section on the Pages > Add New administration panel
- exclude (or ‘hide’) a Page from the list,
- Control which Pages are displayed (i.e., all Pages or just certain SubPages), and
- Control how deep into your Page hierarchy the list goes.
Naturally, you can also link to Pages manually with an HTML link. For example, if you want your Copyright Page listed in your footer, that link might read as below:
If you do not have Permalinks set up
<a title="Copyright information" href="wordpress/?page_id=14">Copyright 1996-2010</a>
If you do have Permalinks set up
<a title="Copyright information" href="wordpress/copyright/">Copyright 1996-2010</a>
Note: Your .htaccess file must be writeable for Page Permalinks to work, otherwise you must update your .htaccess file every time you create a Page.
Organizing Your Pages
Just as you can have Subcategories within your Categories, you can also have SubPages within your Pages, creating a hierarchy of pages.
For example, suppose you are creating a WordPress site for a travel agent and would like to create an individual Page for each continent and country to which the agency can make travel arrangements. You would begin by creating a Page called “Africa” on which you could describe general information about travel to Africa. Then you would create a series of Pages which would be SubPages to “Africa” and might include “Lesotho”, “Cameroon”, “Togo”, and “Swaziland”. Another individual Page is made for “South America” and would feature SubPages of “Brazil”, “Argentina”, and “Chile”. Your site would then list:
- Africa
- Cameroon
- Lesotho
- Swaziland
- Togo
- South America
- Argentina
- Brazil
- Chile
To begin the process, go to Administration > Pages > Add New panel, in the upper right corner of the panel and click the “Page Parent” drop-down menu. The drop-down menu contains a list of all the Pages already created for your site. To turn your current Page into a SubPage, or “Child” of the “Parent” Page, select the appropriate Page from the drop-down menu. If you specify a Parent other than “Main Page (no parent)” from the list, the Page you are now editing will be made a Child of that selected Page. When your Pages are listed, the Child Page will be nested under the Parent Page. The Permalinks of your Pages will also reflect this Page hierarchy.
In the above example, the Permalink for the Cameroon Page would be:
http://example.com/africa/cameroon/