WordPress: Answers-Configuration:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: <div style="border:1px solid blue; background: #CCFFE6; padding:10px; margin:10px; font-size:130%"> These FAQs have been deprecated. You will find the new updated '''Frequently Asked Ques...)
 
 
(未显示2个用户的5个中间版本)
第1行: 第1行:
<div style="border:1px solid blue; background: #CCFFE6; padding:10px; margin:10px; font-size:130%">
<div style="border:1px solid blue; background: #CCFFE6; padding:10px; margin:10px; font-size:130%">
These FAQs have been deprecated. You will find the new updated '''Frequently Asked Questions''' on the new pages for the [[WordPress:FAQ]].
 
这些常见问题解答已经取消了。你在[[WordPress:FAQ|常见问题解答]]的新的页面上会看到新的已更新的'''常见问题解答'''。
</div>
</div>


[[WordPress:FAQ|Back to FAQ]]
[[WordPress:FAQ|返回到常见问题解答]]
== Formatting an Article's List of Categories ==
== 格式化文章的类别列表==


To configure the way a post's categories display, open the <tt>index.php</tt> file and find the text <tt><?php the_category(</tt>. 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.
要配置文章类别的显示方式,请打开<tt>index.php</tt>文件并且找到文本the_category(</tt>。自从那个括号的后面,在引号的里面,是每个类别之间的文本,如果你将一篇文章归为多个类别。
WordPress不会给分隔符添加空格,如果你想要空格,你可以自己添加。例如,如果你希望用逗号将类别分开,请使用<tt> <?php the_category(',&nbsp;')</tt>而不仅仅是 <tt><?php the_category(',')</tt>。与此类似,如果你希望使用bullets分开类别,你可以使用<tt><?php the_category('&nbsp;&amp;bull;&nbsp;')</tt>。


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 <tt> <?php the_category(',&nbsp;')</tt> rather than just <tt><?php the_category(',')</tt>. Similarly, if you want categories to be separated with bullets, you might use <tt><?php the_category('&nbsp;&amp;bull;&nbsp;')</tt>.
== 如果我的审核队列中排了太多的评论==


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


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 '''Options''' &rarr; '''Discussion''' 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.
== 阻止评论中的HTML ==


== Stopping HTML in Comments ==
要阻止人们在评论中使用HTML,或者阻止特别的HTML元素:
#在文件夹<tt>wp-includes</tt>中,找到文件<tt>kses.php</tt>并且打开文件。
#找到文本<tt>$allowedtags</tt>。文本后面带有评论中允许的HTML内容列表。
#要阻止使用某个特别的HTML内容,为那个内容comment out the line 。要comment out a line,请在行的开头输入<tt>//</tt>(一些内容可能已经commented out(删除了))。
#如果你不希望评论中拥有任何HTML内容,你可以删除整个函数—从(!CUSTOM_TAGS)</tt> 到下一个<tt>}</tt> --但是如果你又改变了注意,你需要得到<tt>kses.php</tt>的新复本。


To prevent people from using HTML in comments, or to block particular HTML elements:
== 更改管理员名称 ==
# In the folder <tt>wp-includes</tt>, find the file <tt>kses.php</tt> and open it.
# Find the text <tt>$allowedtags</tt>. It is followed by a list of the HTML elements allowed in comments.
# To prevent a partiular HTML element from being used, comment out the line for that element. To comment out a line, type <tt>//</tt> at the start of the line (some elements will probably be commented out already).
# If you never want any HTML in comments at all, you can delete the whole function -- from <tt>if (!CUSTOM_TAGS)</tt> to the next <tt>}</tt> -- but if you change your mind later, you'll need to get a new copy of <tt>kses.php</tt>.


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


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 ==
要找到网页的绝对路径,将这个文本复制到新的文本文件中:
 
<?php
To find the absolute path of a page, copy this text into a new text file:
<?php
  $p = getcwd();
  $p = getcwd();
  echo $p;
  echo $p;
  ?>
  ?>


Save the file as <tt>path.php</tt>. Then open it in a Web browser (for example, <tt>http://www.example.com/images/path.php</tt>).
将文本保存为<tt>path.php</tt>。然后在网络浏览器中打开文件(如,<tt>http://www.example.com/images/path.php</tt>)。
 
== 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 '''Presentation''' &rarr; '''Theme Editor'''.


; <tt>index.php</tt> : In combination with other PHP files (''see'' Template_Hierarchy), determines the overall HTML structure of each page.
==影响博客显示的文件 ==
有一些主要的文件影响你的站点的显示情况。可以在WordPress控制面板下面的'''呈现''' &rarr; '''主题编辑器'''中更改这些文件。


; <tt>style.css</tt> : Controls fonts, colors, margins, backgrounds, and so on.
; <tt>index.php</tt> :与其它PHP文件相结合(''请看看'' Template_Hierarchy),决定每个页面的HTML结构的整体结构。


; <tt>wp-comments.php</tt> : Controls the layout of user-submitted comments and trackbacks, and the comments submission form.
; <tt>style.css</tt> :控制字体,颜色,页边空白,背景,等等。


; <tt>wp-comments-popup.php</tt> : Only needed if you show comments in a popup window (this option is off by default).
; <tt>wp-comments.php</tt> :控制用户递交的评论和trackbacks,和评论递交形式的布局。


== Showing Comments in Popup Windows ==
; <tt>wp-comments-popup.php</tt> :如果你在弹出的窗口中显示评论,才需要这个文件(默认情况下,这个选项是关闭的)。


To open a popup window when someone clicks a comments link:
== 在弹出的窗口中显示评论==


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


Open <tt>index.php</tt> and find this line:
=== 在 WordPress 1.2 中===
<tt><?php //comments_popup_script(); // off by default ?></tt>
Change it to:
<tt><?php comments_popup_script(); // off by default ?></tt>


=== In WordPress 1.5 Using the "Classic" Theme ===
打开<tt>index.php</tt>并且找到这一行:


Open <tt>header.php</tt> and find this line:
<tt><?php //comments_popup_script(); // 默认情况下关闭 ?></tt>
<tt><?php //comments_popup_script(); // off by default ?></tt>
更改为:
Change it to:
  <tt><?php comments_popup_script(); // 默认情况下关闭?></tt>
  <tt><?php comments_popup_script(); // off by default ?></tt>


=== In WordPress 1.5 Using the Default Theme ===
=== 在WordPress 1.5 中,使用"经典" 主题 ===


Open <tt>header.php</tt> and find this line:
打开<tt>header.php</tt>并且找打这一行:
<tt><?php wp_get_archives('type=monthly&format=link'); ?></tt>
<tt><?php //comments_popup_script(); //默认情况下,关闭 ?></tt>
Directly underneath it, ''add'' this line:
更改为:
  <tt><?php comments_popup_script(); // off by default ?></tt>
  <tt><?php comments_popup_script(); //默认情况下,关闭?></tt>


== Hiding your Site ==
=== 在 WordPress 1.5中,使用默认主题 ===


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.
打开<tt>header.php</tt>并且找到这一行:
<tt><?php wp_get_archives('type=monthly&format=link'); ?></tt>
在这一行的下面,直接地''添加'' 这一行:
<tt><?php comments_popup_script(); // 默认情况下,关闭 ?></tt>


=== Blocking IP addresses using Apache ===
== 隐藏你的站点 ==


You can use the <tt>.htaccess</tt> 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.
不管你是否测试新版本的WP,设置新的博客,或者因为一些其它原因,需要限制权限,下面的信息,会帮助你阻止不必要的访客访问。
* [http://httpd.apache.org/docs/2.2/howto/access.html  Tutorial on blocking IP addresses using <tt>.htaccess</tt>]
=== 使用Apache阻止IP地址===
你可以使用<tt>.htaccess</tt>文件(这个文件也包含你的permalink代码)能够阻止一些IP地址,阻止访客访问你的站点。这只能够阻止IP地址,但是并不能阻止人,因此如果访客更改为一个不属于你的黑名单中的IP地址,这样访客仍然能够访问你的站点。
* [http://httpd.apache.org/docs/2.2/howto/access.html  使用 <tt>.htaccess</tt>阻止IP地址指南]
也可以使用<tt>.htaccess</tt>文件阻止人们"热点链接" 到你的图像(带宽偷窃),或者帮你设置密码保护的站点。


An <tt>.htaccess</tt> 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 ===
除非人们输入正确的密码,否则阻止人们访问你的站点。
==== 使用 Apache ====
* [http://codex.wordpress.org/Glossary#.htaccess .htaccess 定义]
* [http://www.askapache.com/htaccess/apache-htaccess.html Apache <tt>.htaccess</tt> 例子列表]
* [http://httpd.apache.org/docs/2.2/howto/access.html  使用 <tt>.htpasswd</tt>控制权限指南]
* [http://www.clockwatchers.com/htaccess_tool.html  Clockwatchers.com .htaccess 和 .htpasswd 工具]
==== 使用 IIS ====


To block people from accessing your site unless they enter the correct password:
取消选定"允许匿名访问"并且选择"基本的鉴定"。你需要有个带有密码的用户名。
* [http://support.microsoft.com/default.aspx?scid=kb;en-us;310344  怎样配置IIS 5.0网站鉴定]
* [http://support.microsoft.com/kb/299970/EN-US/ 怎样使用NTFS 安全来包含网页]
* [http://support.microsoft.com/default.aspx?scid=kb;en-us;308160  怎样:配置因特网信息服务网络鉴定]
==== 提醒 ====


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


* [http://codex.wordpress.org/Glossary#.htaccess .htaccess Definition]
=== 搜索引擎: Spiders 和 Bots ===
* [http://www.askapache.com/htaccess/apache-htaccess.html Huge list of Apache <tt>.htaccess</tt> examples]
* [http://httpd.apache.org/docs/2.2/howto/access.html  Tutorial on access control using <tt>.htpasswd</tt>]
* [http://www.clockwatchers.com/htaccess_tool.html  Clockwatchers.com .htaccess And .htpasswd tools]


==== Using IIS ===
搜索引擎会索引你的站点并且在搜索结果中保存自己临时的备份。如果你不希望发生这种情况,请使用称为<tt>robots.txt</tt>的文件。
 
Deselect "Allow Anonymous Access" and select "Basic Authentication". You'll also need to have a username with a password.
 
* [http://support.microsoft.com/default.aspx?scid=kb;en-us;310344  How To Configure IIS 5.0 Web Site Authentication]
* [http://support.microsoft.com/kb/299970/EN-US/ How To Use NTFS Security to Protect a Web Page]
* [http://support.microsoft.com/default.aspx?scid=kb;en-us;308160  HOW TO: Configure Internet Information Services Web Authentication]
 
==== 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 <tt>robots.txt</tt>.
* [http://www.askapache.com/seo/updated-robotstxt-for-wordpress.html Sample <tt>robots.txt</tt> optimized for SEO]
* [http://www.askapache.com/seo/updated-robotstxt-for-wordpress.html Sample <tt>robots.txt</tt> optimized for SEO]
* [http://www.twentysteps.com/creating-the-ultimate-wordpress-robotstxt-file/ Creating the ultimate <tt>robots.txt</tt>]
* [http://www.twentysteps.com/creating-the-ultimate-wordpress-robotstxt-file/ 创建最终的 <tt>robots.txt</tt>]
* [http://www.askapache.com/seo/wordpress-robotstxt-optimized-for-seo.html SEO Optimized <tt>robots.txt</tt> and robots meta for WordPress]
* [http://www.askapache.com/seo/wordpress-robotstxt-optimized-for-seo.html SEO Optimized <tt>robots.txt</tt> and robots meta for WordPress]
* [http://www.google.com/support/webmasters/bin/answer.py?answer=40361 Google information about robots.txt]
* [http://www.google.com/support/webmasters/bin/answer.py?answer=40361 Google 关于 robots.txt的信息]
 
== 使得其他人上传图像==


== Letting People Upload Images ==
允许图像上传到你的站点上:


To permit image uploads to your site:
#从管理面板中,进入'''选项''' &rarr; '''Miscellaneous'''。
#选择'''允许文件上传'''。为了帮助找到绝对路径,请看看[[WordPress:Answers-Configuration#Absolute_Path | 绝对路径]]。关于更改权限的帮助,请看看[[WordPress:Changing_File_Permissions| Changing_File_Permissions]]。
#在主要的菜单上,你应该在'''选项'''和'''退出'''之间看到新的'''上传'''内容。


# From the admin panel, go to '''Options''' &rarr; '''Miscellaneous'''.
[[WordPress:FAQ|返回到常见问题解答]]
# Select '''Allow File Uploads'''. For help finding the absolute path, see [[WordPress:Answers-Configuration#Absolute_Path | Absolute Path]]. For help changing permissions, see [[WordPress:Changing_File_Permissions]].
# In the main menu, you should now see a new '''Upload''' item between '''Options''' and '''Log Out'''.
[[WordPress:FAQ|Back to FAQ]]

2008年9月23日 (二) 18:25的最新版本

这些常见问题解答已经取消了。你在常见问题解答的新的页面上会看到新的已更新的常见问题解答

返回到常见问题解答

格式化文章的类别列表[ ]

要配置文章类别的显示方式,请打开index.php文件并且找到文本the_category(。自从那个括号的后面,在引号的里面,是每个类别之间的文本,如果你将一篇文章归为多个类别。 WordPress不会给分隔符添加空格,如果你想要空格,你可以自己添加。例如,如果你希望用逗号将类别分开,请使用 <?php the_category(', ')而不仅仅是 <?php the_category(',')。与此类似,如果你希望使用bullets分开类别,你可以使用<?php the_category(' &bull; ')

如果我的审核队列中排了太多的评论[ ]

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

阻止评论中的HTML[ ]

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

  1. 在文件夹wp-includes中,找到文件kses.php并且打开文件。
  2. 找到文本$allowedtags。文本后面带有评论中允许的HTML内容列表。
  3. 要阻止使用某个特别的HTML内容,为那个内容comment out the line 。要comment out a line,请在行的开头输入//(一些内容可能已经commented out(删除了))。
  4. 如果你不希望评论中拥有任何HTML内容,你可以删除整个函数—从(!CUSTOM_TAGS) 到下一个} --但是如果你又改变了注意,你需要得到kses.php的新复本。

更改管理员名称[ ]

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

找到网页的绝对路径[ ]

要找到网页的绝对路径,将这个文本复制到新的文本文件中: <?php

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

将文本保存为path.php。然后在网络浏览器中打开文件(如,http://www.example.com/images/path.php)。

影响博客显示的文件[ ]

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

index.php
与其它PHP文件相结合(请看看 Template_Hierarchy),决定每个页面的HTML结构的整体结构。
style.css
控制字体,颜色,页边空白,背景,等等。
wp-comments.php
控制用户递交的评论和trackbacks,和评论递交形式的布局。
wp-comments-popup.php
如果你在弹出的窗口中显示评论,才需要这个文件(默认情况下,这个选项是关闭的)。

在弹出的窗口中显示评论[ ]

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

在 WordPress 1.2 中[ ]

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

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

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

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

打开header.php并且找打这一行: <?php //comments_popup_script(); //默认情况下,关闭 ?> 更改为:

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

在 WordPress 1.5中,使用默认主题[ ]

打开header.php并且找到这一行: <?php wp_get_archives('type=monthly&format=link'); ?> 在这一行的下面,直接地添加 这一行:

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

隐藏你的站点[ ]

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

使用Apache阻止IP地址[ ]

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

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

基本的鉴定[ ]

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

使用 Apache[ ]

使用 IIS[ ]

取消选定"允许匿名访问"并且选择"基本的鉴定"。你需要有个带有密码的用户名。

提醒[ ]

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

搜索引擎: Spiders 和 Bots[ ]

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

使得其他人上传图像[ ]

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

  1. 从管理面板中,进入选项Miscellaneous
  2. 选择允许文件上传。为了帮助找到绝对路径,请看看 绝对路径。关于更改权限的帮助,请看看 Changing_File_Permissions
  3. 在主要的菜单上,你应该在选项退出之间看到新的上传内容。

返回到常见问题解答