Codex tools: Log in
Contents |
The New To WordPress - Where to Start article accompanies this section, though it contains duplicate information and should be merged with this section.
A self-hosted WordPress blog has a number of advantages over freely hosted blogs. With a self-hosted WordPress blog, you have complete control over your code, so you can implement any theme, modify it entirely, or create your own. You can add any plugin you want, and then hack the code. The application's code is completely open, allowing you total access to modify, tweak, or explore what you want.
WordPress also has a large community of enthusiastic bloggers who help each other in forums, create and share themes and plugins, and help move the software forward with new features and better design. With such freedom, what you can do with a WordPress blog can be a bit overwhelming. The WordPress Codex (the wiki manual for WordPress) has hundreds of pages and can be daunting in scope.
The intent of this WordPress Quick Start Guide is to get you up and running with WordPress and give you a brief overview of the most important concepts and techniques. It covers the most common setup tasks you need to technically launch, configure, and manage your blog. It then lays down some concepts for more advanced theme modification.
Note: WordPress.org differs from WordPress.com in a fundamental way. WordPress.org provides WordPress software that you can download and install on the server space you rent from a web host. In contrast, WordPress.com provides free hosting for your WordPress.com blog, but restricts the themes and plugins you can implement. With WordPress.com, you have to pay extra to modify your stylesheet, and you can't display ads or manipulate any of the code. (For more information on the difference, see WordPress.com Versus WordPress.org. Everything in this guide relates to self-hosted WordPress blogs.
One tool you'll need to manage your WordPress files is an FTP program, such as Filezilla. Through FTP, you'll upload themes and plugins to your blog. If your web host doesn't provide any auto-installers, you'll need an FTP program to install your blog.
Filezilla is a simple program. All it requires is your web address, username, and password to connect to your web host. When you connect, the remote host's files appear in the right column, while your local files appear in the left column. You transfer files or folder from your local host to the remote host by dragging the files to the remote host column. After you enter your FTP details once, use drop-down arrow next to the Quick Connect button to connect immediately.
More Information:
You need a web host that has PHP and MySQL. To make the installation of WordPress as simple as possible, make sure your web host has cPanel (or something similar). In my experience, BlueHost probably has the best support of any web host, and it has the easiest auto-installer: Simple Scripts. After you sign up with a web host, navigate to the cPanel (or the equivalent) and look for Simple Scripts, Fantastico, or some other auto-installer for WordPress. If there isn't an auto-installer, you have to install WordPress manually following the "famous 5 minute install" instructions, which are fairly simple. See the resources below for instructions on the different installation methods.
To install WordPress on a Web host:
The WordPress installation arranges files in three main folders (wp-admin, wp-content, and wp-includes). It also installs loose files in the root folder. Most of the time, when you work with your WordPress files through FTP, you'll be uploading content to the wp-content folder.
Note:When you connect to your remote host, you may have to go into the public_html or www folder to see the WordPress files. Both folders open the door to your WordPress content. The folders simply mirror each other to deliver the same results when users go to either http://www.yourdomain.com or http://yourdomain.com.
The wp-content folder has two important subfolders: plugins and themes. When you upload a plugin or theme to these folders using FTP, the plugin or theme is available for activation inside your WordPress admin panel. Also, any images you upload when writing a post in WordPress are stored in the wp-content/uploads folder.
More Information:
Once you have WordPress installed, you should spend some time exploring it. To log in to your newly installed blog, go to http://yourblogdomain.com/wp-admin and enter the username and password you used when you set up the site.
After logging in, you'll see the admin panel that you use to write posts and modify your blog. Tour the admin panel. The Admin panel provides four main tabs at the top and three smaller tabs on the far right, described as follows:
Explore these main tabs and subtabs to see the different functions they perform.
More Information:
You need to configure some basic settings in your blog, such as the title, tagline, time zone, and your name. Click the Settings tab on the far right, and then browse through the available subtabs -- General, Writing, Reading, Discussion, Privacy, Permalinks, and Miscellaneous. Select the options you want.
As you're configuring your settings, be sure to enable permalinks and allow comments without moderation. Permalinks make your URLs intelligible names that reflect the title of your post, rather than something like ?p=123. Comments also need configuration. By default, comments must be approved before they appear on your site.
To configure your settings, at the very least do the following:
More Information:
If you're transitioning to WordPress from another blog platform, you can import your old content. Go to Manage > Import and select the specific software you're importing from. Almost all blogs can be imported into WordPress. However, when you import content from another site, only the posts, categories, and tags import, not any pictures.
More Information:
Posts are the regular blog entries you write that appear on your home page. You write posts by clicking the Write tab. By default, the Posts subtab is selected. Complete the fields and information, select or create a category, and then click the Publish button. Writing posts is the most common activity you'll do in the admin panel. When you write blog posts, keep your paragraphs short, use subheadings, include images, and avoid a stuffy tone. To insert a "Read more ..." tag, click the Read More button on the toolbar.
More Information:
Pages are for content such as "About Me," "Contact Me," etc. Pages live outside of the normal blog chronology, aren't included in your RSS feed. They're 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.)
More Information:
Categories help make sense of the hundreds of posts you'll be writing. By assigning the posts into different categories, you can allow readers to browse archives of only that category. To create a category, click the +Add New Category link in the Categories section below the post you're writing. You can select multiple categories for the same posts. To manage your categories, go to Manage > Categories.
Additionally, through categories, you can manipulate your posts in advanced ways, such as excluding certain categories from your home page, or specifying where certain categories should appear. This is a common technique for magazine-style layouts, where you have different sections on the home page and you want posts from those categories to always appear in those sections.
You can also give each category its own unique layout and design. For example, if you copy the content of your archive.php file, rename it to category-24.php (or whatever the category ID is), and then modify the file (such as removing the sidebar, or changing the header), the archives for that category will use the category-24.php file rather than archive.php file.
More Information:
Tags are like micro-categories or index keywords for your posts. Your site should probably only have 7-12 categories, but you can have hundreds of tags. Clicking a tag name below your post will show all posts with the same tag, helping readers find similar content (most readers arrive at your site through searches for a specific topic). You add tags to your posts by typing the tag names in the Tags section below the post. You can also manage your tags by going to Manage > Tags.
If tags are enabled in your theme, you will usually see them below the published post. If not, you can add a php tag to make it appear. (Because tagging is new with WordPress 2.3, many themes don't have the Tag template tag added by default.) If you go to Design > Theme Editor and click the single.php file, you'll see the code that generates your posts. Add <?php the_tags(); ?> to this file where you want the tags to appear (usually after the <?php the_content ?> tag, which generates your post content).
More Information:
One of the neat things about WordPress is that you can edit any post or page by clicking the Edit link that usually appears at the bottom or top of each page. You can also edit your posts and pages from the Manage tab, but sometimes it's easier to just navigate to the content you want to edit and click Edit.
To edit a page or post:
If the Edit link doesn't appear, it's because your theme designer has omitted it from the code. You can add it by going to Design > Theme Editor. Click the single.php file, and then add the following code after the <?php the_content(); ?> tag:
<?php edit_post_link('Edit', '', ' | '); ?>
Now when you view a post, an Edit link appears at the bottom, after the content. If you log out, the Edit link is hidden.
More Information:
WordPress allows you to apply any theme to your blog. All themes include a CSS stylesheet that defines the design and layout (the colors, arrangement, and shape) of your site. In WordPress, the content is completely separate from the format, so you can change themes at any time without having to alter your content.
In the past, WordPress attempted to create a central theme repository called the WordPress Theme Viewer. However, due to numerous issues with the repository, themes for WordPress are now scattered all across the web. Weblogtoolscollection often features newly released themes. The footer of most blogs identifies the theme the user has applied. You can search for "WordPress themes" and find a good variety of them. You can also buy a well-designed theme usually for $100 or less (search for "designer WordPress themes" or "premium WordPress themes"). In general, when choosing a theme, find one that's simple and focuses your eye on your the content. You can always change it when you get tired of it.
To apply a new theme to your site:
After selecting a new theme, you may need to configure the sidebar, page navigation, and header. Always make sure it looks good in both Firefox and IE. If you have a question about a theme, try visiting the author's site first. If that doesn't work, go to the theme section of the WordPress forum.
More Information:
Themes usually have at least 1 or 2 sidebars. Sidebars are the narrow columns to the left or right of your blog posts. Each section in the sidebar is known as a "widget" that you can move up or down. Sidebars commonly list your pages, contact information, top posts, RSS feed, some about text, links, and ads.
To configure your sidebar:
More Information:
One of the most common ways you'll want to customize your theme is by changing the banner image. Exactly how you do this depends on the theme you're using. But in general, here's how you alter the banner image:
Alternatively, you can keep the original file, but just change the file name in the stylesheet.
The header style in your stylesheet may look like this:
#header {
background: url("<?php bloginfo('stylesheet_directory'); ?>/images/wc_header.jpg")
no-repeat bottom center; }
By changing the background attribute (wc_header.jpg), you can change the header image/background.
Sometimes the header doesn't have an image at all, but instead uses a background color. To change the background color:
More Information:
Different themes show pages in different ways. Themes that have buttons or tabs at the top sometimes populate those buttons/tabs with your pages automatically. Other themes generate your list of pages in the sidebar. Other themes require you to manually type the page URLs.
You should know several things about the ordering of pages. If a list of pages (that you created) automatically appear on your site, you can change their order through the Page Order field that appears below the page.
To change the page order:
Tip: If you're listing your pages in your sidebar, the Pages widget has an Edit link that allows you to define the way the pages are sorted and what pages are excluded.
Note: If you have a theme with 5 tabs across the top (coded to automatically fill these tabs with your pages), yet you have 10 pages, you'll either want to manually code the links in your header.php file (available by going to Design > Theme Editor), or modify the arguments in the wp_list_pages tag to exclude pages you don't want to appear in your header. The Pages sidebar widget provides easy fields to note exclusions. But if your theme has a navigation or tab bar, editing the pages is trickier. The list of pages is automatically generated in your code through the <?php wp_list_pages('arguments'); ?> tag. You can modify the "arguments" text with different parameters that define how you want your pages to appear. For example, you can include or exclude pages from the list, include child pages, define their sort order, and so on. See the instructions about the wp_list_pages template tag for more information.
More Information:
One of the most important features of your site is your RSS feed, which subscribers will use to add you to their feedreaders. All WordPress blogs have RSS feeds by default, and even categories and specific posts have RSS feeds. You can see your feed by adding /feed after your domain. For example, if http://idratherbewriting.com is my domain, then http://idratherbewriting.com/feed is my RSS feed.
However, unless you redirect your feed through Feedburner, it's hard to know how many people are subscribed to your blog. You may have seen little chiclets on blogs showing how many people are subscribed. This is a Feedburner chiclet that you can easily insert on your site.
To direct your feed through Feedburner and add a subscriber chiclet on your site:
Note: If you don't use the Feedburner Feedsmith plugin, readers may still be able to subscribe to your blog's default feed rather than the redirected Feedburner feed. When Firefox and IE sense an RSS feed on a site, they display an orange RSS button to the right of the web address field. If readers click this button, it shows the site's default feed rather than the Feedburner feed. You can change the feed that appears in the web address field by editing the feed listed in your site's header file.
To change the feed in your header:
For example, a line in your header that specifies the feed looks something like this:
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
The <?php bloginfo('rss2_url'); ?> automatically populates with your feed. Swap your Feedburner feed in there instead. For example:
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="http://feeds.feedburner.com/tomjohnson" />
More Information:
WordPress plugins are scripts you install to extend the functionality of your blog. For example, one common plugin is Subscribe to Comments Reloaded. When added, it allows readers to receive notification of follow-up comments for posts they've commented on. WordPress doesn’t ship with this feature already included — you must install it via a plugin.
WordPress's philosophy is to keep the core light and simple. And then allow people to add, in a cafeteria style, the plugins they need for the functionality they want. The process of discovering new plugins — and suddenly transforming your blog into something more — can be exciting.
You install a plugin in the same way you install a theme, except you upload it to wp-content/plugins rather than wp-content/themes. However, in contrast to themes, you can update plugins directly from within WordPress (when the plugin author has updates). This is because plugins are centralized in a WordPress plugin repository that your WordPress software hooks into.
To install a plugin:
More Information:
Spam robots will flood your posts with spam unless you take some protections and activate Akismet. WordPress includes Akismet by default, but you have to first activate the plugin and then enter an API key.
To activate the Akismet plugin:
After you do this, you'll see a link that prompts you to enter your WordPress.com API key. Here's where it gets a little bizarre. You have to sign up for a WordPress.com account before you can get a WordPress.com API key, even though your blog has nothing else to do with WordPress.com.
To get an API key:
You can see how much spam Akismet stops by going to Comments > Akismet Spam. It's a good idea to periodically check the spam to make sure no legitimate comments land in there. If your blog is brand new, you may not get much comment spam. But the more hits your blog gets, the more comment spam it attracts.
Some people make the mistake of requiring users to log in to comment, or they moderate all comments before they appear. In general, it's easier to delete the occasional comment spam than to approve each comment.
More Information:
Every post and page you write in WordPress is stored in a MySQL database. There aren't separate files for each page or post. It's important to regularly back up your database in case something goes wrong (such as with a rogue plugin or a misguided upgrade attempt). You can manually back up your database by using a tool like phpmyadmin, but it's much easier to simply use the WordPress Database Backup plugin.
To create a regular database backup schedule:
Each week, you'll receive an email with your database. The database is light and won't take up much space in your email program. If your site ever crashes, you can restore your entire site's posts, pages, categories, and tags (but not images) through the database file. Images are stored in wp-content/uploads folder
More Information:
Readers should be able to contact you in two ways: (1) by leaving a comment under a post, and (2) by contacting you through an email address or contact form. Several plugins provide immediate contact forms you can implement on your site. This way when a literary agent contacts you for a book deal, or a conference organizer wants to ask you to deliver the keynote, the person can actually contact you.
Two contact forms you can use are as follows:
The first contact form is more robust than the second. Both work well. To implement either contact form:
WordPress has hundreds of cool plugins that add functionality to your blog. The following list includes my favorites. Note: Every plugin serves a different purpose, so these plugins may not meet your needs. For example, you may have a community site and need a way to include a robust calendar, group authoring, and password protection, but I haven't listed them here. There are plugins for almost everything you can imagine. The following list is by no means exhaustive.
As you explore the code in your theme's files (Design > Theme Editor), you'll see that the code consists of XHTML and PHP tags. PHP is the scripting language that WordPress uses to pull information from the database, where your blog's data is stored. WordPress uses different PHP tags to call different types of information from the database. When the user clicks on a page that has a PHP tag, WordPress dynamically calls the data from the database and displays it.
PHP tags begin with a <?php and end with a ?>. The text between this tag is the function. For example, the following PHP tag shows all your categories, but with a specific parameter to exclude categories 10, 11, and 12:
<?php wp_list_cats('exclude=10,11,12'); ?>
WordPress has many different template tags similar to wp_list_cats. You can view all the different template tags here. Each tag calls different information and allows you to pass different parameters in the parentheses (). Read up on a tag to see exactly what it calls and how it's used.
More Information:
Your blog's style -- the colors, the fonts, the widths, and so on -- is mainly styled by your theme's stylesheet. To make adjustments to your blog's style, go to Design > Theme Editor, click the stylesheet file, and make changes. Since themes are individually created by a wide variety of people, stylesheets from one theme to the next all look a bit different (but all conform to CSS standards). The theme designers create styles to define different sections, but one designer's style names may vary with that of another designer's names. Additionally, some use CSS shorthand and compress the info into a small space, while others break out each of the selector's attributes onto a different line.
To find the name of a style, you can use Firefox Web Developer extension to identify the CSS of a specific element, and then go into your stylesheet to modify that element. The more familiar you are with CSS, the easier it will be to modify the styles. See W3schools' tutorial on CSS for a good foundation.
Each theme has a collection of files with names like index.php, archive.php, single.php, and so on. WordPress dynamically pulls together these files based on what the user clicks. For example, if the user clicks your blog's home page, the home.php or index.php file is used (WordPress first looks for home.php first; if no home.php exists, it looks for index.php).
Additionally, the home.php or index.php file includes several other files, namely header.php, footer.php, and sidebar.php. While the files exist separately, they are pulled into one file through include statements in the home.php or index.php file. If you remove the <?php get_sidebar(); ?> include tag from your index.php file, the sidebar won't show anymore.
It's important to know which user queries call which templates. The following are the theme templates used when a user clicks something on your blog:
Some themes have more template files than others. When a template file is absent or simply not used, usually the index.php file substitutes. Also, sometimes the index.php has some conditional statements that show different code based on different queries, so your blog may actually have different views for the home page versus a single post, but the differences are defined within the same file through conditional statements.
More Information:
As you explore the code, one thing you should learn to recognize is "the Loop." The Loop is a section of PHP code that tells WordPress to display the latest posts from the database on your blog. It's an important piece of code because the appearance of each post on your blog is controlled by what's inside the Loop.
For example, on many blogs, there's no byline because the blog is written by a single author. But on group blogs, you need an author byline beneath each post, something that says By Tom Johnson, or whoever the post author is. Yet the author tag won't appear in every post if it's not included inside the Loop. To show the author tag on every post, you have to add <?php the_author(); ?> inside the Loop.
To see the loop, go to Design > Theme Editor and open the single.php file or index.php file. The Loop begins with this code:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
And then usually some template tags come after this line, so that your post title, post content, the time, and comments appear. You would add the author tag somewhere between the start and end of the Loop, depending on where you want the author byline displayed. The end of the Loop is identified by this code:
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
You may also want to alter the way the other post content appears. So it's good to be aware of the Loop.
Additionally, if you're playing around with the code and you alter the Loop's start or end tags, your content won't display at all (and you'll probably start hyperventilating). If you recognize the Loop, you can easily fix the code.
Finally, some plugins will require that you add a certain line of code "inside the Loop." When that's the case, you open up your index.php, archive.php, or single.php file or any other file that has the loop, and insert the code between the starting or ending point of the Loop.
More Information:
Unlike with commercial software, upgrading WordPress currently requires you to manually replace most of your old files with the latest release. Major upgrades are released at least three times a year, with minor upgrades released more frequently. When it's time to upgrade your blog, you'll see a note in your admin panel prompting you to upgrade to the latest version.
You can upgrade your files manually, which includes backing up your database, overwriting most (but not all) of your WordPress files, and going to an upgrade file to run an upgrade script. However, a much easier way to upgrade your software is through the WordPress Automatic Upgrade plugin. This plugin automates most of the upgrade steps through an on-screen wizard. (If you use the WordPress Automatic Upgrade plugin, choose the manual mode rather than the automatic mode.) Eventually the WordPress core will offer one-click upgrades rather than requiring this tedious upgrade process.
Upgrading plugins is much easier because WordPress hooks into the plugin's code. To upgrade your plugins, go to the Plugins tab and click the Upgrade Automatically link that appears as a note above plugins that have available updates.
More Information:
One thing to remember with WordPress is that it's an open source project, with many people from different backgrounds and countries contributing themes, plugins, and other code. As such, sometimes the plugins and themes break, or are incompatible, or have other issues. At some point, you may need help with WordPress, either because your theme doesn't look right, or because a plugin is causing an error. If you need help, use the following resources:
Note: One must-know tip is how to search both the forums and Codex. Rather than using the built-in search feature, do a site-search using Google. Go to Google.com and type something like site:wordpress.org upgrading wordpress. You'll find that searching through Google yields much better results than using the built-in search features in the Codex or forums.
More Information: