WordPress:Answers-Configuration

来自站长百科
Fludlen讨论 | 贡献2008年9月22日 (一) 15:01的版本
跳转至: 导航、​ 搜索
可打印版不再被支持且可能有渲染错误。请更新您的浏览器书签并改用浏览器默认的打印功能。


These FAQs have been deprecated. You will find the new updated Frequently Asked Questions on the new pages for the WordPress: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.

要配置文章类别的显示方式,请打开index.php文件并且找到文本the_category(。自傲那个括号的后面,在引号的立马,是每个类别之间的文本,如果你将一篇文章归为多个类别。

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; ').

WordPress不会给分隔符添加空格,如果你想要空格,你可以自己添加。例如,如果你希望用逗号将类别分开,请使用 <?php the_category(', ')而不仅仅是 <?php the_category(',')。与此类似,如果你希望使用bullets分开类别,你可以使用<?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.

如果任何人递交的评论都出现在你的审核队列中,这可能是你的垃圾广告词列表方面的问题。在选项讨论下面仔细地查看列表,确保列表上没有什么内容包含单一的字符,空白的行,或者其它的空格。有时候,反垃圾广告插件可能会带入一些空白的行。

Stopping HTML in Comments

阻止评论中的HTML

To prevent people from using HTML in comments, or to block particular HTML elements:

要阻止人们在评论中使用HTML,或者阻止特别的HTML元素:

  1. In the folder wp-includes, find the file kses.php and open it.
  1. 在文件夹wp-includes中,找到文件kses.php并且打开文件。
  1. Find the text $allowedtags. It is followed by a list of the HTML elements allowed in comments.
  1. 找到文本$allowedtags。文本后面带有评论中允许的HTML内容列表。
  1. To prevent a partiular HTML element from being used, comment out the line for that element. To comment out a line, type // at the start of the line (some elements will probably be commented out already).
  1. 要阻止使用某个特别的HTML内容,为那个内容comment out the line 。要comment out a line,请在行的开头输入//(一些内容可能已经commented out(删除了))。
  1. If you never want any HTML in comments at all, you can delete the whole function -- from if (!CUSTOM_TAGS) to the next } -- but if you change your mind later, you'll need to get a new copy of kses.php.
  1. 如果你不希望评论中拥有任何HTML内容,你可以删除整个函数—从(!CUSTOM_TAGS) 到下一个} --但是如果你又改变了注意,你需要得到kses.php的新复本。

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.

要更改WordPress管理员帐户,请作为管理员登录到WordPress,然后选择用户。在你的基本资料下面,你可以输入你的姓名或者昵称。

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;
?>

<?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).

将文本保存为path.php。然后在网络浏览器中打开文件(如,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.

有一些主要的文件影响你的站点的显示情况。可以在WordPress控制面板下面的呈现主题编辑器中更改这些文件。

index.php
In combination with other PHP files (see Template_Hierarchy), determines the overall HTML structure of each page.
index.php
与其它PHP文件相结合(请看看 Template_Hierarchy),决定每个页面的HTML结构的整体结构。
style.css
Controls fonts, colors, margins, backgrounds, and so on.
style.css
控制字体,颜色,页边空白,背景,等等。
wp-comments.php
Controls the layout of user-submitted comments and trackbacks, and the comments submission form.
wp-comments.php
控制用户递交的评论和trackbacks,和评论递交形式的布局。
wp-comments-popup.php
Only needed if you show comments in a popup window (this option is off by default).
wp-comments-popup.php
如果你在弹出的窗口中显示评论,才需要这个文件(默认情况下,这个选项是关闭的)。

Showing Comments in Popup Windows

在弹出的窗口中显示评论

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

但有人点击评论链接的时候,打开弹出的窗口:

In WordPress 1.2

在 WordPress 1.2 中

Open index.php and find this line:‘

打开index.php并且找到这一行:

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

Change it to:

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

<?php //comments_popup_script(); // 默认情况下关闭 ?> 更改为:

<?php comments_popup_script(); // 默认情况下关闭?>

In WordPress 1.5 Using the "Classic" Theme

在WordPress 1.5 中,使用"经典" 主题

Open header.php and find this line:

打开header.php并且找打这一行:

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

Change it to:

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

<?php //comments_popup_script(); //默认情况下,关闭 ?> 更改为:

<?php comments_popup_script(); //默认情况下,关闭?>

In WordPress 1.5 Using the Default Theme

在 WordPress 1.5中,使用默认主题

Open header.php and find this line:

打开header.php并且找到这一行:

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

Directly underneath it, add this line:

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

<?php wp_get_archives('type=monthly&format=link'); ?> 在这一行的下面,直接地添加 这一行:

<?php comments_popup_script(); // 默认情况下,关闭 ?>

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.

不管你是否测试新版本的WP,设置新的博客,或者因为一些其它原因,需要限制权限,下面的信息,会帮助你阻止不必要的访客访问。

Blocking IP addresses using Apache

使用Apache阻止IP地址

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.

你可以使用.htaccess文件(这个文件也包含你的permalink代码)能够阻止一些IP地址,阻止访客访问你的站点。这只能够阻止IP地址,但是并不能阻止人,因此如果访客更改为一个不属于你的黑名单中的IP地址,这样访客仍然能够访问你的站点。

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.

也可以使用.htaccess文件阻止人们"热点链接" 到你的图像(带宽偷窃),或者帮你设置密码保护的站点。

Basic Authentication

基本的鉴定

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

除非人们输入正确的密码,否则阻止人们访问你的站点。

Using Apache

使用 Apache


= Using IIS

= 使用 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.

拥有基本的鉴定,密码编码不强(使用base-64),会轻易地破解。

Search Engines: Spiders and Bots

搜索引擎: Spiders 和 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.

搜索引擎会索引你的站点并且在搜索结果中保存自己临时的备份。如果你不希望发生这种情况,请使用称为robots.txt的文件。




Letting People Upload Images

使得其他人上传图像

To permit image uploads to your site:

允许图像上传到你的站点上:

  1. From the admin panel, go to OptionsMiscellaneous.
  1. 从管理面板中,进入选项Miscellaneous
  1. Select Allow File Uploads. For help finding the absolute path, see Absolute Path. For help changing permissions, see WordPress:Changing_File_Permissions.
  1. 选择允许文件上传。为了帮助找到绝对路径,请看看 绝对路径。关于更改权限的帮助,请看看 Changing_File_Permissions
  1. In the main menu, you should now see a new Upload item between Options and Log Out.
  1. 在主要的菜单上,你应该在选项退出之间看到新的上传内容。

Back to FAQ 返回到常见问题解答