Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Answers-Configuration

These FAQs have been deprecated. You will find the new updated Frequently Asked Questions on the new pages for the FAQ.

Back to FAQ

Formatting an Article's List of Categories

To configure the way a post's categories display, open the index.php file and find the text <?php the_category(. Immediately after that bracket, inside quote marks, is the text that goes between each of the categories if you apply multiple categories to a post.

WordPress doesn't add spaces to the separators, so if you want them, add them yourself. For example, if you want categories to be separated with commas, use <?php the_category(', ') rather than just <?php the_category(','). Similarly, if you want categories to be separated with bullets, you might use <?php the_category(' &bull; ').

If Too Many Comments Go to Your Moderation Queue

If almost every comment anyone submits ends up in your moderation queue, there's probably a problem with your spam words list. Check the list under OptionsDiscussion carefully to ensure it doesn't have any items consisting of a single character, a blank line, or other whitespace. Sometimes blank lines can be introduced by spam plugins.

Changing the Admin Name

To change the name of the WordPress admin account, log in to WordPress as admin, then choose Users. Under Your Profile you can enter your first name, last name, and nickname.

Finding the Absolute Path of a Page

To find the absolute path of a page, copy this text into a new text file:

<?php
$p = getcwd();
echo $p;
?>

Save the file as path.php. Then open it in a Web browser (for example, http://www.example.com/images/path.php).

Files Affecting Weblog Display

These are the main files affecting the display of your site. They can be edited from the WordPress control panel under PresentationTheme Editor.

index.php 
In combination with other PHP files (see Template_Hierarchy), determines the overall HTML structure of each page.
style.css 
Controls fonts, colors, margins, backgrounds, and so on.
wp-comments.php 
Controls the layout of user-submitted comments and trackbacks, and the comments submission form.
wp-comments-popup.php 
Only needed if you show comments in a popup window (this option is off by default).

Showing Comments in Popup Windows

To open a popup window when someone clicks a comments link:

In WordPress 1.2

Open index.php and find this line:

<?php //comments_popup_script(); // off by default ?>

Change it to:

<?php comments_popup_script(); // off by default ?>

In WordPress 1.5 Using the "Classic" Theme

Open header.php and find this line:

<?php //comments_popup_script(); // off by default ?>

Change it to:

<?php comments_popup_script(); // off by default ?>

In WordPress 1.5 Using the Default Theme

Open header.php and find this line:

<?php wp_get_archives('type=monthly&format=link'); ?>

Directly underneath it, add this line:

<?php comments_popup_script(); // off by default ?>

Hiding your Site

Whether you're testing a new version of WP, setting up a new blog or have some other reason to limit access, the following information may help you keep unwanted visitors out.

Blocking IP addresses using Apache

You can use the .htaccess file (which also contains your permalink code) to check for certain IP addresses and prevent them from viewing your site. This will only stop the IP address, not the person, so if they can switch to an IP address not in your blacklist, they will still be able to get to your site.

An .htaccess file can also be used to prevent people from "hot-linking" to your images (bandwidth theft), or to set up a password-protected site.

Basic Authentication

To block people from accessing your site unless they enter the correct password:

Using Apache

= Using IIS

Deselect "Allow Anonymous Access" and select "Basic Authentication". You'll also need to have a username with a password.

Warning

With basic authentication, the password is encoded weakly (using base-64), and can be easily intercepted and decoded.

Search Engines: Spiders and Bots

Search engines will index your site and keep their own temporary copy of it for use in returning search results. If you do not want this to happen, use a file called robots.txt.

Letting People Upload Images

To permit image uploads to your site:

  1. From the admin panel, go to OptionsMiscellaneous.
  2. Select Allow File Uploads. For help finding the absolute path, see Absolute Path. For help changing permissions, see Changing_File_Permissions.
  3. In the main menu, you should now see a new Upload item between Options and Log Out.

Back to FAQ