Wordpress 中文
Advertisement

常見問題集:關於 WordPress

Back to FAQ

管理[ | ]

Can my posts have titles instead of /index.php?p=76?[ | ]

See:

How can I find out if I have mod_rewrite?[ | ]

To get information about your server, you can use the PHP Info function:

  • Paste this into a new Notepad / BBEdit file
<?php phpinfo(); ?>
  • Save as info.php
  • Upload to server. Visit in your browser (www.example.com/info.php)

That will give you info about your php version and mod_rewrite.

The info.php file returns a page outlining the details of your PHP installation. You can see if mod_rewrite is loaded. Under the apache header, look in the Loaded Modules section and see if mod_rewiite is listed.

How do I change file and folder permissions?[ | ]

See:

  • Changing File Permissions

Why are the version numbers not in any particular periodic sequence?[ | ]

The version number for improved versions of WordPress might not follow a strictly monotonic or periodic numerical (or in the case of test releases, alphabetical) sequence, since the version numbers reflect relative progress, and the changes made to existing or previous versions. So, for example, since v1.2 is a majorly revamped version of v1.0 (with about 60% of the code having been touched), 1.1 was ’skipped』 along the way.

How do I turn on Permalinks, and what do I do about the errors?[ | ]

See:

What are User Levels for and what permissions do different User Levels have?[ | ]

See:

Does the 644 permissions on wp-config.php compromise the username and password to all other users on my shared server?[ | ]

This is a limitation of the way PHP is set up on your server. If you previously used MovableType, Perl was probably set up with suexec so Movable Type executed as your user. In this case, PHP is running as the web server user, which is why it has to be at least 444. There is phpsuexec but it seems many hosts don’t use it.

However this is often not an issue on modern shared hosts because even though the file is 「world" readable each account is set up with a 「jailshell" which keeps people locked in their home directory, and PHP can be easily modified with an open_basedir restriction to keep people from writing PHP scripts to read your files. If you are really concerned, you should contact your host to see what measures they are taking.

How do I redirect users to the index.php page after the login from wp-login.php?[ | ]

In wp-login.php find the following line of code :

<input type="hidden" name="redirect_to" value="wp-admin/" /></input>

and change that to

<input type="hidden" name="redirect_to" value="index.php" /></input>

If your weblog is set up to have the index page in a different directory from the WordPress files, then you will have to replace index.php in the above line of code with the relative path (with respect to wp-login.php) of the blog’s index page to make this work.

This will redirect users to the index.php page instead of the wp-admin/index.php page after they log in.

How do I change permissions for my files so I can edit them using the Template Editor?[ | ]

See:

  • Changing File Permissions

How do I prevent my images from being hot-linked by another website?[ | ]

You can use your .htaccess file to protect images from being hot linked, or, in other words, being linked-to from other websites. This can be a drain on your bandwidth, because if someone links directly to the image on your site, then you lose the bandwidth.

Clockwatchers』 htaccess image guide provides more details.

You can use this tool to check if the images are protected properly, and that has a few extra tips too.

For a more sophisticated method of preventing hotlinking see A List Apart's Smarter Image Hotlinking Prevention.

How do I backup and restore my WordPress database using phpMyadmin?[ | ]

See:

How do I prevent comment flooding?[ | ]

Comment flooding is when a lot of comments (probably spam) are posted to your website in a very short duration of time. Mark Ghosh's article, Comment flood prevention-a really simple solution, and the related Comment flood prevention hack, allows you set a time interval between each comment to prevent successive comments from being posted too soon.

A copy of the code modification is given below (this is for WP 1.2) :

In wp-comments-post.php (between the comments, you should recognize the place), add the following:

// Simple flood-protection
$lasttime = $wpdb->get_var("SELECT comment_date FROM $tablecomments ORDER BY comment_date DESC LIMIT 1″);
if (!empty($lasttime)) {
$time_lastcomment= mysql2date(’U', $lasttime);
$time_newcomment= mysql2date(’U', $now);
if (($time_newcomment - $time_lastcomment) < 300)
die( __(’Sorry, this blog only allows a new comment once every 300 seconds. If you really want to write a comment,
just wait a few and hit refresh on this page. Chances are you tried to add a comment about halfway between 0 and 300 seconds.   
Comment flooders are annoying. Thank you for being patient.’) );
}

Why can't I delete the uncategorized Category?[ | ]

Any Category with a non-zero value for # of Posts in the Administration > Manage > Categories cannot be deleted. The uncategorized Category might be assigned to some Posts, but all Pages are assigned the uncategorized Category. So even though there may be no posts assigned to the uncategorized Category, Pages are included in the count of # of Posts. 975955279902366263508491

配置[ | ]

How can I change how the date and / or time is displayed?[ | ]

See:

  • Formatting Date and Time

How can I control comments people make?[ | ]

See:

  • Comment Moderation

What do the Discussion Options mean?[ | ]

See:

  • Discussion Options

How do I install plugins?[ | ]

See:

  • Managing Plugins

How can I change what appears between Categories when I post in more than one Category?[ | ]

To configure the way the post's categories display, open the index.php file and find the line <div class meta>. There you will see the following code:

<?php the_category() ?>

Inside of the parentheses ( ) and quote marks, add or change this to reflect the new look you desire.

If you would like to have commas between the categories, the tag should read:

<?php the_category(',') ?>

If you would like to have an arrow, the tag would look like this:

<?php the_category(' > ') ?>

If you would like to have a bullet, the tag would look like this:

<?php the_category(' &bull; ') ?>

If you would like the "pipe" ( | ) between the categories, the tag would look like this:

<?php the_category(' | ') ?>

Use your imagination and creativity to make the separations in the categories look any way you like.

Why are all the comments being moderated?[ | ]

Go to the Options > Discussion panel and make sure that An administrator must approve the comment (regardless of any matches below) is unchecked. With that option selected, all comments are sent to the moderation queue to await approval. Make sure that Hold a comment in the queue if it contains more than x links is not blank and contains a number higher than zero. If this value is blank or zero, all comments containing links will be moderated. If the option mentioned above is unchecked, the link moderation value is higher than zero, and you still have this problem, your Spam Words list probably has blank lines, punctuation marks, or single letters between the information in the list. There should be spaces between the listed items or each item must be on its own line. If you have done this, then upgrade the comment spam plugins you have installed. If this continues to be a problem, deactivate the comment spam plugins one by one to determine the culprit and contact the plugin author for help.

How do I stop people from posting HTML in comments?[ | ]

Acceptance of HTML tags in the comments field is managed in the file kses.php, located in the wp-includes folder.

Open this file in a text editor, and locate the list of HTML tags near the top of the file. Each HTML tag is listed on a separate line, in the construction of a PHP array of allowed tags. Lines which begin with // are commented-out, or disabled, so lines which begin with // designate HTML tags that are not allowed in comments.

To stop people from posting HTML in comments, edit your kses.php file as desired to allow or disallow specific HTML tags in comments, by adding // to the very beginning of the appropriate lines of the list. To exclude all HTML tags, comment out all lines which allow HTML tags. Be sure to save your file when done.

Note that while you could simply delete the lines instead of commentng them out, by adding // at the start of the line you achieve the same result, while preserving the list of tags for possible re-enabling at a later date.

How do I disable comments?[ | ]

First, unchecked Allow people to post comments on the article on the Options > Discussion panel. This will only disabled comments on future posts. Now, to completely disable comments, you will have to edit each past post and uncheck Allow Comments from the Write Post SubPanel. Alternatively, you could run this MySQL query from the command line on a shell account or using phpMyAdmin: UPDATE wp_posts SET comment_status="closed";

If your goal is to permanently disable comments, then you should delete the wp-comments-post.php file as well.

How do I disable trackbacks and pingbacks?[ | ]

First, unchecked Allow link notifications from other Weblogs (pingbacks and trackbacks.) on the Options > Discussion panel. This will only disabled trackbacks and pingbacks on future posts. Now, to completely disable trackbacks and pingbacks, you will have to edit each past post and uncheck Allow Pings from the Write Post SubPanel. Alternatively, run this MySQL query from the command line on a shell account or using PHPMyAdmin: UPDATE wp_posts SET ping_status="closed";

If your goal is to permanently disable trackbacks and pingbacks, then you should delete the wp-trackback.php file as well.

How do I disable my RSS or syndicated feeds?[ | ]

To disable your RSS or syndicated feeds, you must delete the wp-atom.php, wp-commentsrss2.php, wp-feed.php, wp-rdf.php, wp-rss.php, and wp-rss2.php files.

How do I change the site admin name?[ | ]

To change your Admin Name, in the Administration Panel, choose the Users->Your Profile tab. Make your changes there.

See:

  • Your Profile SubPanel

How do I find the absolute path I need for uploading images?[ | ]

To find the absolute path of a page, absolutepath.zip will help you. Download, unzip, ftp to the location of the page / image / directory and then call the file in your browser - http://www.example.com/images/absolutepath.php

Which files do I change to alter the way my blog looks?[ | ]

The following files affect the public display of your site, and each can be easily changed by using the Built-in Editor from the Templates option in your admin screen:

   * index.php
     This affects the layout of your content.
   * style.css
     This is how the style and presentation of your blog is controlled.
   * wp-comments.php
     This controls the layout of user-submitted comments and trackbacks, 
     and the comments submission form.
   * wp-comments-popup.php
     Only needed if you decide to use a popup comments box.
     (Popup comments are off by default).

Can I have popup comments?[ | ]

To enable popup comments, choose the appropriate method for the version of WordPress you are using.

WordPress version 2.0 Default Theme

Inside header.php add this line:

<?php comments_popup_script(); ?>

above this line:

<?php wp_head(); ?>

For example:

<?php comments_popup_script(); ?>
<?php wp_head(); ?>
</head>

WordPress 2.0 Classic Theme

In the file header.php locate this line (line 21):

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

And remove the first comment markers, changing it to this:

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

WordPress version 1.5 Default Theme

Inside header.php add this line:

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

below this line:

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

Example:

<?php wp_get_archives('type=monthly&format=link'); ?>
<?php comments_popup_script(); // off by default ?>
<?php wp_head(); ?>

WordPress version 1.5 Classic Theme

Inside header.php is this line:

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

Change that to

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

WordPress version 1.2

Inside index.php is this line:

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

Change that to

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

How do I upload images?[ | ]

To permit images to be uploaded to your site:

From the admin panel, go to Options -> Miscellaneous

  • Select the option to Allow File Uploads
  • Then check main menu across the top. Click Upload
  • In Wordpress 2.0, go to Write -> Write Post or Write -> Write Page and use the upload interface therein.

Can I change where the WordPress Database Plugin saves the backups?[ | ]

Currently (as of WordPress 2.0) the WordPress Database Plugin saves the backups in the folder wp-content/backup-xxxxxx (where xxxxxx is a randomly generated sequence). To change the folder used, change the wp-db-backup.php file.

In Version 1.7 of the WordPress Database Plugin you would change line 22 of wp-db-backup.php where it says

define('WP_BACKUP_DIR', 'wp-content/backup-' . $rand);

to something like:

define('WP_BACKUP_DIR', 'mydir/mysubdir');


修改[ | ]

Can I change the Smilies?[ | ]

See:

  • Using Smilies

How do I edit files?[ | ]

See:

  • Editing Files

What is The Loop?[ | ]

See:

How can I change the URL-structure for my posts?[ | ]

See:

How can I change URL-structure for my posts on a Windows server?[ | ]

See:

How do I use WordPress Template Tags to change what is displayed on the blog?[ | ]

See:

How do I get All links to open in a new window?[ | ]

Put this inside the <head> section of your Theme's template header.php file:

<base target="_blank" />

See:

How can I add an image to my RSS feed?[ | ]

See:

How can I stop my own comments being mailed to me?[ | ]

WordPress version 1.2 This will stop WP from sending you a mail if the email address you used when you posted the comment was the same as the email address for the author of the post (which is the address the notification email gets sent to). This applies to v1.2 / 1.2.1 code ONLY.

In functions.php change the following line:

if ( == $user->user_email) return false; // If there's no email to send the comment to

to

if ( == $user->user_email || $comment->comment_author_email == $user->user_email) return false; // If there's no email to send the comment to

If I turn off comments, it says "Comments Off" on the weblog. so how do I change that?[ | ]

To turn your comments feature off:

WordPress version 1.2

Line 58 of wp-includes/template-functions-comment.php has the words 'Comments Off'

WordPress version 1.3

Line 98 of wp-includes/template-functions-comment.php has the words 'Comments Off'

How do I change what is shown when I password protect a post?[ | ]

To create password protected text, see Line 19 of wp-includes/template-functions-post.php for that information.

How can I allow certain HTML tags in my comments?[ | ]

WordPress versions prior to 1.2

If you would like to override the $allowedtags variable in kses.php you may do so in your my-hacks.php file, provided you add the following code after you set up the $allowedtags array.

define('CUSTOM_TAGS', true);

How can I add advanced search ability to WordPress?[ | ]

See:

提交[ | ]

How do I upload an image and display it in a post?[ | ]

To permit images to be uploaded to your site:

  • From the Administration Panel->Options->Miscellaneous
    • Select the option to Allow File Uploads
  • If you need help with finding the absolute path, visit Absolute Path
  • If you need help with changing permissions, visit Changing_File_Permissions
  • Then check main menu across the top. Click Upload

Refer to the following articles to align the image in the post:

See:

  • Using Images
  • Photoblogs and Galleries
  • Wrapping Text Around Images

What is pingback?[ | ]

See:

What is trackback?[ | ]

See:

Where is the permalink to my post?[ | ]

See:

  • Linking Posts, Pages, and Categories

Can I use desktop blogging software?[ | ]

See

  • Weblog Client

Can I blog by email?[ | ]

See

垃圾, 評論[ | ]

What can I do to stop comment spam?[ | ]

See:

  • Combating Comment Spam

More Information on Comment Spam[ | ]

See:

What Spam words do I need?[ | ]

See:

  • Spam Words

Why are all the comments being moderated?[ | ]

If you are getting all comments sent to moderation when they should not, it's probably your spam words list in Administration Panel->Options -> Discussion. It probably has either a single character, OR a blank line OR extra whitespace. Take those out.

Right click in the Spam Words box, Select All then Copy and paste it into Notepad to check it.

With spam plugins adding to that list, it's not easy to check for odd data, and it's easy to miss multiple blank lines. This way makes it easier.

Check it carefully :)

Back to FAQ

Advertisement