WordPress: FAQ Working with WordPress:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: Back to FAQ __TOC__ <div style="clear:both"> </div> ==Administration== ===Can my posts have titles instead of /index.php?p=76?=== See: * WordPress:Using Permalinks...)
 
无编辑摘要
 
(未显示3个用户的5个中间版本)
第1行: 第1行:
[[WordPress:FAQ|Back to FAQ]]
<span style="border:1px solid #000; text-align:center; float:right; padding:6px;"><strong>导航:</strong> [[WordPress:WordPress文档|上一级]] | [[WordPress]] | {{Template:WordPress导航}}</span>
<div style="clear:both;"></div>
[[WordPress:FAQ|返回FAQ]]
__TOC__
__TOC__
<div style="clear:both">
<div style="clear:both">
</div>
</div>
==管理==
===我的文章可以有标题而不是 /index.php?p=76?===
参见:
* [[WordPress:Using Permalinks|使用Permalinks]]


==Administration==
===如果我有mod_rewrite我如何找出?===
===Can my posts have titles instead of  /index.php?p=76?===
要想得到关于你的服务器的信息,你可以使用PHP Info 功能:
See:
* [[WordPress:Using Permalinks]]
 
===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
*把下边语句粘贴到一个新的记事本 / BBEdit 文件中


  <tt><?php phpinfo(); ?></tt>
  <tt><?php phpinfo(); ?></tt>


*Save as '''info.php'''
*另存为 '''info.php'''
*Upload to server. Visit in your browser (www.example.com/info.php)
*上传到服务器. 在浏览器中访问 (www.example.com/info.php)
 
That will give you info about your php version and [[WordPress:Glossary#mod_rewrite| 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.
浏览器会显示出关于你的php 版本和 [[WordPress:Glossary#mod_rewrite| mod_rewrite]]的信息.


===How do I change file and folder permissions?===
'''info.php'''文件返回一个列出你的PHP安装详细信息的页面. 你可以查看是否mod_rewrite 被载入. 在'''apache'''页眉下面, 查看'''Loaded Modules''' 部分,可以看到是否mod_rewiite 列出.
See:
* [[WordPress: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.
参见:
* [[WordPress:Changing File Permissions|改变文件许可]]


===How do I turn on Permalinks, and what do I do about the errors?===
===为什么版本号不是按照任何特定的周期序列?===
See:
WordPress更新版本的版本号WordPress 可能不是按照某个严格的不变的或者是周期数字排列(或者是测试版的按字母顺序排列), 因为版本号反应出了相关程序, 现有或者前版本的改变。这样,如,因为版本1.2主要是修正版本1.0 (大约是60% 的代码经过改动), 1.1 就被 ’跳过’了。
* [[WordPress:Using Permalinks]]


===What are User Levels for and what permissions do different User Levels have?===
See:
* [[WordPress:User Levels]]


===Does the ''644'' permissions on ''wp-config.php'' compromise the username and password to all other users on my shared server?===
===我如何打开Permalinks, 我该如何处理错误?===
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.
参见:
* [[WordPress:Using Permalinks|使用Permalinks]]


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.
===用户等级有什么用不同的等级有什么权限?===
参见:
* [[WordPress:User Levels|用户等级]]
===''wp-config.php''的''644''权限会危及在我的共享服务器上的其他用户的用户名和密码吗?===
这是一个PHP 在你的服务器上安装时的局限. 如果你以前使用了MovableType, 带有suexec 的Perl 可能已经安装,这样 Movable Type 作为你的使用者来执行. 在这种情况下, PHP 作为服务器用户运行。这就是为什么必须至少是 444. 有一个phpsuexec但是似乎很多主机都不使用它.


===How do I redirect users back to my blog's main page after they login?===
尽管如此,这通常在现代共享主机上不是什么问题,因为文件是随便阅读的,但是每个帐户建立时带有“jailshell" ,保证人们被锁在自己的目录中, PHP 还可以轻易的使用 open_basedir进行约束,保证人们不能改写PHP脚本来阅读你的文件. 如果你实在需要,你可以联系主机,看看可以采取什么措施。
Install the plugin, [http://wordpress.org/support/topic/143646 From where you came], and if your users clicked the ''Log in'' link from your main page, they will be directed back to that page after they login.
<!--old method left for now but doesn't work at 2.5
This allows you to redirect users to your blog's main page, instead of the administrative panel, after they log in.


In ''wp-login.php'', find the following line of code:
<nowiki>if ( !isset( $_REQUEST['redirect_to'] ) || is_user_logged_in() )</nowiki>
Immediately after that line, find this line:
<nowiki><$redirect_to = 'wp-admin/';</nowiki>
and change that to:
<nowiki>$redirect_to = 'index.php';</nowiki>


If your blog is set-up to have the index page in a different directory from the WordPress files (see [[WordPress:Giving_WordPress_Its_Own_Directory]]), then you need to make the reference to ''index.php'' with a [[WordPress:Glossary#Relative_Path|relative path]] with respect to ''wp-login.php''.  For example, if your WordPress files are in a folder called wordpress, but you have an index.php file in your webroot folder, you would change the line of code to:
===用户登陆后我如何重定向用户回到我的blog主页?===
<nowiki>$redirect_to = '../index.php';</nowiki>
安装插件,[http://wordpress.org/support/topic/143646 From where you came], 如果你的用户从主页点击了''Log in'' 链接,他们就会在登陆后被直接返回。


------------
===我如何为我的文件改变权限,这样我可以使用模板编辑器编辑它们?===
Sorry, but that didn't work! After a while, the user still ends on the Dashboard. And in Wordpress 2.5 not even the code matches.
参见:
-------------
* [[WordPress:Changing File Permissions|更改文件权限]]
-->
===我如何防止我的图片被别的站点做成热链接?===
你可以使用你的.htaccess文件来保护图片不被热链接, 或者, 换句话说, 被别的网站链接到了. 这可能会影响你的带宽,因为如果某人直接链接到你的站点上的图片,你就失去了这部分带宽。


===How do I change permissions for my files so I can edit them using the Template Editor?===
[http://www.clockwatchers.com/htaccess_images.html Clockwatchers的htaccess 图片指导] 给出了更多详细内容.
See:
* [[WordPress: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.


[http://www.clockwatchers.com/htaccess_images.html Clockwatchers’ htaccess image guide] provides more details.
要想得到对付热链接的更好的办法请查看[http://www.alistapart.com/articles/hotlinking/ A List Apart's Smarter Image Hotlinking Prevention].


You can use this tool to check if the images are protected properly, and that has a few extra tips too.
===我如何使用phpMyadmin备份和恢复我的WordPress数据库?===
参见:
* [[WordPress:Backing Up Your Database|备份你的数据库]] 和 [[WordPress:Restoring Your Database From Backup|通过备份恢复你的数据库]]


For a more sophisticated method of preventing hotlinking see [http://www.alistapart.com/articles/hotlinking/ A List Apart's Smarter Image Hotlinking Prevention].
===我如何阻止灌水?===
灌水是当很多的回帖(可能是垃圾信息)在很短的一个持续时间段在你的站点上同时出现。 [http://mindfulmusings.net/weblog Mark Ghosh's]的文章, [http://weblogtoolscollection.com/archives/2004/07/07/comment-flood-prevention-a-really-simple-solution/ 阻止灌水-一个非常简单的解决方法], 以及相关的[http://weblogtoolscollection.com/archives/2004/07/07/more-comment-flood/ 组织灌水hack], 允许你设置一个每两个贴之间的时间间隔,可以防止回帖太快。


===How do I backup and restore my WordPress database using phpMyadmin?===
代码修改的一个附件如下 (适用WP 1.2) :
See:
* [[WordPress:Backing Up Your Database]] and [[WordPress:Restoring Your Database From Backup]]


===How do I prevent comment flooding?===
在wp-comments-post.php (在回帖中间,你应该找到合适的地方), 加入如下代码:
Comment flooding is when a lot of comments (probably spam) are posted to your website in a very short duration of time. [http://mindfulmusings.net/weblog Mark Ghosh's] article, [http://weblogtoolscollection.com/archives/2004/07/07/comment-flood-prevention-a-really-simple-solution/ Comment flood prevention-a really simple solution], and the related [http://weblogtoolscollection.com/archives/2004/07/07/more-comment-flood/ 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
  // Simple flood-protection
第98行: 第82行:
  }
  }


===Why can't I delete the ''uncategorized'' Category?===
===为什么我不能删除''未分类的''分类?===
Any Category with a non-zero value for ''# of Posts'' in the [[WordPress:Administration Panels|Administration]] >  
任何[[WordPress:Administration Panels|Administration]] >  
[[WordPress:Administration_Panels#Manage_-_Change_your_content|Manage]] > [[WordPress:Manage_Categories_SubPanel|Categories]] '''cannot''' be deletedThe ''uncategorized'' Category might be assigned to some Posts, but '''all''' [[WordPress:Pages|Pages]] are assigned the ''uncategorized'' Category. So even though there may be no posts assigned to the ''uncategorized'' Category, [[WordPress:Pages|Pages]] are included in the count of ''# of Posts''.
[[WordPress:Administration_Panels#Manage_-_Change_your_content|Manage]] > [[WordPress:Manage_Categories_SubPanel|Categories]]中''# of Posts'' 值不为零的分类'''不能''' 被删除.  ''未分类的'' 分类必然指向某个文章,但是'''所有''' [[WordPress:Pages|页面]] 指向这个''未分类的'' 分类.这样尽管可能没有文章指向这个''未分类的'' 分类,[[WordPress:Pages|页面]]还是包含在 ''# of Posts''的记录当中。


The default category cannot be deleted even if it is empty, however you can specify your default categories for posts or links on the ''Options'' - ''Writing'' page of the admin panel.
默认的分类不能被删除,即使它是空的,尽管如此你可以在管理面板中的''Options'' - ''Writing''为你的帖子或者链接指定你的默认分类。
 
===Why is there no Page Template option when writing or editing a Page?===
If there is no Page Template option when writing or editing a [[WordPress:Pages|Page]] it may because there is no [[WordPress:Stepping Into Templates|template file]] with the proper structure.  For the Page Template box to be available to assign to a [[WordPress:Pages|Page]] there must be a least one template file in your theme that has a structure at the beginning of the template file that looks like this:


===为什么写或者编辑页面时没有页面模板操作?===
如果写或者编辑[[WordPress:Pages|页面]]时没有页面模板操作,可能是因为没有 带有合适结构的[[WordPress:Stepping Into Templates|模板文件]]。 为了让页面模板框可用来分配 [[WordPress:Pages|页面]],你的主题中必须至少有一个模板文件,在模板文件开头的地方拥有如下代码:
<pre>
<pre>
<?php
<?php
第115行: 第99行:
</pre>
</pre>


That example is from the WordPress Default themes wp-content/themes/default/links.php file.
这个例子来自WordPress 默认主题wp-content/themes/default/links.php file.
 
See also:
 
[[WordPress:Pages#Page_Templates|Page Templates]]
 
== Configuration ==


===How can I change how the date and / or time is displayed?===
参见:
See:
* [[WordPress:Formatting Date and Time]]


===How can I control comments people make?===
[[WordPress:Pages#Page_Templates|页面模板]]
See:
* [[WordPress:Comment Moderation]]


===What do the Discussion Options mean?===
== 配置 ==
See:
* [[WordPress:Discussion Options]]


===How do I install plugins?===
===我如何才能改变日期/ 或者时间如何显示?===
See:
参见:
* [[WordPress:Managing Plugins]]
* [[WordPress:Formatting Date and Time|确定日期和时间格式]]
===我如何控制别人的评论?===
参见:
* [[WordPress:Comment Moderation|适度评论]]
=== Discussion Options 意味着什么?===
参见:
* [[WordPress:Discussion Options| Discussion Options]]
===我如何安装插件?===
参见:
* [[WordPress: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 '''<nowiki><div class meta></nowiki>'''.  There you will see the following code:
要想设定分类的显示, 打开'''index.php'''文件然后找到 '''<nowiki><div class meta></nowiki>'''.  你会看到如下代码:


<tt><?php the_category() ?></tt>
<tt><?php the_category() ?></tt>


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:
如果你想让分类中间是逗号,标签如下:


<tt><?php the_category(',') ?></tt>
<tt><?php the_category(',') ?></tt>


If you would like to have an arrow, the tag would look like this:
如果你想要箭头,标签如下:


<tt><?php the_category(' > ') ?></tt>
<tt><?php the_category(' > ') ?></tt>


If you would like to have a bullet, the tag would look like this:
如果你想要分隔符,标签如下:


<tt><?php the_category(' &amp;bull; ') ?></tt>
<tt><?php the_category(' &amp;bull; ') ?></tt>


If you would like the "pipe" ( | ) between the categories, the tag would look like this:
如果你想要"竖线"( | ) 标签如下:


<tt><?php the_category(' | ') ?></tt>
<tt><?php the_category(' | ') ?></tt>


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 [[WordPress:Administration_Panels#Options_-_Configuration_Settings|Options]] > [[WordPress:Administration_Panels#Discussion|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 [[WordPress: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?===
===为什么所有的评论必须审核?===
找到[[WordPress:Administration_Panels#Options_-_Configuration_Settings|Options]] > [[WordPress:Administration_Panels#Discussion|Discussion]]面板确定'''An administrator must approve the comment (regardless of any matches below)''' 是未选中状态. 如果选中这个选项, 所有的评论会被发送到队列中以等待审核。确认'''Hold a comment in the queue if it contains more than x links''' 是非空的,包含一个大于零的数字。如果这个值是空白或者零,所有的评论包含的链接都会被调整。如果上面提到的操作都是未选中的,链接调整值大于零,你还会碰到问题, 你的 [[WordPress:Spam Words|垃圾信息词语]] 列表信息中可能会有空行,标点或者单一的字母。在列表项目之间必须有空格或者每个项目必须在它自己的那一行中。如果你完成这些后,然后更新一下你安装的评论垃圾信息插件。如果问题仍然存在,一个一个的禁用评论垃圾信息插件来确定问题出在哪里,联系插件作者寻求帮助。


Acceptance of HTML tags in the comments field is managed in the file '''kses.php''', located in the '''wp-includes''' folder.
===如何阻止别人发布HTML 评论?===


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 <tt>//</tt> are '''commented-out''', or disabled, so lines which begin with <tt>//</tt> designate HTML tags that are '''not''' allowed in comments.
是否允许评论区域的HTML 标签由'''kses.php'''文件管理,该文件在'''wp-includes''' 文件夹中。


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  <tt>//</tt> 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.
使用文本编辑器打开这个文件, 把HTML 标签列表定位在文件顶部。每个HTML 标签都列在一个单独的行,在允许的标签中的一个PHP数组结构中。以<tt>//</tt> 开头的行都是'''commented-out''', 或者是禁用的。所以以<tt>//</tt>开始的指定的HTML标签都是'''不''' 允许出现在评论中的。


Note that while you could simply delete the lines  instead of commentng them out, by adding <tt>//</tt> 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.
要想阻止人们在评论中添加HTML, 编辑你的 '''kses.php''' 文件,按照你想要的,允许或者不允许特定的HTML标签出现在评论中,可以通过添加<tt>//</tt>到列表的适当的行的最前面实现。 要想阻止所有的HTML标签, 就注释掉所有允许HTML标签的行. 确认完成后保存文件。


===How do I disable comments?===
注意如果你可以删除这些行的话,最好还是用注释掉来代替删除, 通过在每行开始的地方添加<tt>//</tt>来达到相同的结果,这样可以确保将来可能想重新激活这些标签。
First, unchecked '''Allow people to post comments on the article''' on the [[WordPress:Administration_Panels#Options_-_Configuration_Settings|Options]] > [[WordPress:Administration_Panels#Discussion|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 [[WordPress:Write Post SubPanel|Write Post SubPanel]].  Alternatively, you could run this MySQL query from the command line on a shell account or using [[WordPress:phpMyAdmin]]:  <tt>UPDATE wp_posts SET comment_status="closed";</tt>


If your goal is to permanently disable comments, then you should delete the <tt>wp-comments-post.php</tt> file as well.
===我如何禁用评论?===
首先,在[[WordPress:Administration_Panels#Options_-_Configuration_Settings|Options]] > [[WordPress:Administration_Panels#Discussion|Discussion]] 面板上不要勾上'''Allow people to post comments on the article''' .  This will only disabled comments on ''future posts''.现在,为了完全的不能让别人评论,你将在[[WordPress:Write Post SubPanel|写文章的子面板]]上的编辑过的每篇文章上不要勾上'''Allow Comments'''  或者,你可以在shell帐户的命令行上运行MYSQL查询或者使用[[WordPress:phpMyAdmin]]:  <tt>UPDATE wp_posts SET comment_status="closed";</tt>
如果你的目标是让人永久的不能评论,你该删除<tt>wp-comments-post.php</tt>文件


===How do I disable trackbacks and pingbacks?===
First, unchecked '''Allow link notifications from other Weblogs (pingbacks and trackbacks.)''' on the [[WordPress:Administration_Panels#Options_-_Configuration_Settings|Options]] > [[WordPress:Administration_Panels#Discussion|Discussion]] panel.  This will only disable 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: <tt>UPDATE wp_posts SET ping_status="closed";</tt>


If your goal is to permanently disable trackbacks and pingbacks, then you should delete the <tt>wp-trackback.php</tt> file as well.
===我该如何禁用trackbacks 和pingbacks?===
首先在 [[WordPress:Administration_Panels#Options_-_Configuration_Settings|Options]] > [[WordPress:Administration_Panels#Discussion|Discussion]] 面板中,取消选中'''Allow link notifications from other Weblogs (pingbacks and trackbacks.)'''. 这只是在''将来的文章中''禁用了trackbacks 和 pingbacks 。现在,完全禁用trackbacks 和 pingbacks,你将不得不编辑每个过去的文章并且从Write Post子面板取消选中'''Allow Pings'''  作为选择,在一个外壳账号上从命令行运行 MySQL 查询或者使用PHPMyAdmin: <tt>UPDATE wp_posts SET ping_status="closed";</tt>


===How do I disable my RSS or syndicated feeds?===
如果你的目标是永远禁用trackbacks 和pingbacks, 那么你还应该删除 <tt>wp-trackback.php</tt> 文件。
To disable your RSS or syndicated feeds, you must delete the <tt>wp-atom.php</tt>, <tt>wp-commentsrss2.php</tt>, <tt>wp-feed.php</tt>, <tt>wp-rdf.php</tt>, <tt>wp-rss.php</tt>, and <tt>wp-rss2.php</tt> files.


===How do I change the ''site admin'' name?===
===我如何禁用 RSS 或者是 syndicated feeds?===
To change your Admin Name, in the [[WordPress:Administration_Panels|Administration Panel]], choose the '''Users->Your Profile''' tabMake your changes there. However, you are not able to change the username from within the Administration panel. In order to do this you must directly edit the MySQL database, however this is not recommended as your username is not often seen by other users.
想禁用RSS 或 syndicated feeds, 你必须删除<tt>wp-atom.php</tt>, <tt>wp-commentsrss2.php</tt>, <tt>wp-feed.php</tt>, <tt>wp-rdf.php</tt>, <tt>wp-rss.php</tt>, 和 <tt>wp-rss2.php</tt>文件。
===我如何更改 ''站点管理'' 的名字?===
要想改变你的管理名字,在[[WordPress:Administration_Panels|Administration Panel]],选择 '''Users->Your Profile''' 标签在这里进行更改。尽管如此,你不能在管理面板中更改用户名 。为了更改名字你必须直接编辑 MySQL 数据库。尽管如此,建议不要该你的用户名,因为别人并不能经常看见你的名字。


See:
参见:
* [[WordPress:Your Profile SubPanel]]
* [[WordPress:Your Profile SubPanel|你的个人文件子面板]]
 
===我如何找到所需的绝对路径上传图片?===
===How do I find the absolute path I need for uploading images?===
为了找到一个页面的绝对路径,[http://www.tamba2.org.uk/downloads/absolutepath.zip absolutepath.zip] 可以帮助你。下载,解压缩,上传到page / image / directory 的位置,然后在浏览器中浏览文件 - http://www.example.com/images/absolutepath.php
To find the absolute path of a page, [http://www.tamba2.org.uk/downloads/absolutepath.zip 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
===我可以改变哪个文件来替换我的blog外观?===
 
以下几个文件影响你的站点的外观, 通过管理界面的'''Templates'''操作里的内建编辑器,每一个都可以很容易的做出改动:
===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'''
     * '''index.php'''
       This affects the layout of your content.
       影响内容的版面.


     * '''style.css'''
     * '''style.css'''
       This is how the style and presentation of your blog is controlled.
       控制你的blog的样式和界面.


     * '''wp-comments.php'''
     * '''wp-comments.php'''
       This controls the layout of user-submitted comments and trackbacks,  
       这个控制用户提交注释和trackbacks,还有评论提交的版面 .
      and the comments submission form.


     * '''wp-comments-popup.php'''
     * '''wp-comments-popup.php'''
       Only needed if you decide to use a popup comments box.
       只有当你决定使用 popup comments box.的时候才需要
       (Popup comments are off by default).
       (Popup comments 默认时是关闭的).


===Can I have popup comments?===
===我能拥有popup comments吗?===
To enable popup comments, choose the appropriate method for the version of WordPress you are using.
想要激活popup comments, 根据你使用的WordPress版本选择合适的方法.


'''WordPress version 2.0 Default Theme'''
'''WordPress 2.0版本默认主题'''
 
'''header.php''' 内加入该行:
Inside '''header.php''' add this line:
  <tt><?php comments_popup_script(); ?></tt>
  <tt><?php comments_popup_script(); ?></tt>


''above'' this line:
添加在下面这行''之上'':
<pre><?php wp_head(); ?></pre>
<pre><?php wp_head(); ?></pre>


For example:
例如:


<pre>
<pre>
第234行: 第210行:
</head></pre>
</head></pre>


'''WordPress 2.0 Classic Theme'''
'''WordPress 2.0 经典主题'''


In the file '''header.php''' locate this line (line 21):
在文件'''header.php'''中找到这行 (第21行):
<pre><?php //comments_popup_script(); // off by default ?></pre>
<pre><?php //comments_popup_script(); // off by default ?></pre>


And remove the first comment markers, changing it to this:
然后删除第一个注释标记,更改为:
<pre><?php comments_popup_script(); // off by default ?></pre>
<pre><?php comments_popup_script(); // off by default ?></pre>


'''WordPress version 1.5 Default Theme'''


Inside '''header.php''' ''add'' this line:
'''WordPress 1.5版本默认主题'''
 
'''header.php''' ''添加'' 该行:
  <tt><?php comments_popup_script(); // off by default ?></tt>
  <tt><?php comments_popup_script(); // off by default ?></tt>


''below'' this line:
在下面这行代码''之下'':


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


Example:
例如:


<pre><?php wp_get_archives('type=monthly&format=link'); ?>
<pre><?php wp_get_archives('type=monthly&format=link'); ?>
第257行: 第234行:
<?php wp_head(); ?></pre>
<?php wp_head(); ?></pre>


'''WordPress version 1.5 Classic Theme'''
'''WordPress 1.5 版本经典主题'''


Inside '''header.php''' is this line:
'''header.php'''内有如下这行代码:
  <tt><?php //comments_popup_script(); // off by default ?></tt>
  <tt><?php //comments_popup_script(); // off by default ?></tt>
Change that to
更改为
  <tt><?php comments_popup_script(); // off by default ?></tt>
  <tt><?php comments_popup_script(); // off by default ?></tt>


'''WordPress version 1.2'''
'''WordPress 1.2版本'''


Inside '''index.php''' is this line:
'''index.php''' 内有如下这行代码:
  <tt><?php //comments_popup_script(); // off by default ?></tt>
  <tt><?php //comments_popup_script(); // off by default ?></tt>
Change that to
更改为
  <tt><?php comments_popup_script(); // off by default ?></tt>
  <tt><?php comments_popup_script(); // off by default ?></tt>


===How do I upload images?===
===我如何上传图片?===


To permit images to be uploaded to your site:
要想允许上传图片到你的站点:


From the admin panel, go to '''Options -> Miscellaneous'''
从管理面板中找到'''Options -> Miscellaneous'''
*Select the option to '''Allow File Uploads'''
*选择'''Allow File Uploads'''
**If you need help with finding the absolute path, see [[WordPress:#How_do_I_find_the_absolute_path_I_need_for_uploading_images.3F|How do I find the absolute path I need for uploading images?]].
**如果你需要找到绝对路径的帮助信息,参见 [[WordPress:#How_do_I_find_the_absolute_path_I_need_for_uploading_images.3F|我如何找到所需的绝对路径上传图片?]].
**If you need help with changing permissions, visit [[WordPress:Changing_File_Permissions]].
**如果你需要更改许可的帮助信息,参见 [[WordPress:Changing_File_Permissions|更改文件许可]].
*Then check main menu across the top. Click '''Upload'''
*然后查看顶部的主目录,点击'''Upload'''
*In Wordpress 2.0, go to '''Write -> Write Post''' or '''Write -> Write Page''' and use the upload interface therein.
*Wordpress 2.0中,找到'''Write -> Write Post''' 或者 '''Write -> Write Page''' 然后使用其中的上传界面。


===Can I change where the WordPress Database Plugin saves the backups?===
===我可以改变WordPress Database Plugin 把备份保存在那吗?===
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.
通常(到WordPress 2.0为止) WordPress Database Plugin 把备份保存在文件夹 ''wp-content/backup-xxxxxx'' (xxxxxx 是一个随机生成的序列号).  想改变使用的文件夹,改变''wp-db-backup.php'' 文件就可以了.


In Version 1.7 of the WordPress Database Plugin you would change line 22 of ''wp-db-backup.php'' where it says
在WordPress Database Plugin版本1.7,你可以改变第22行的 ''wp-db-backup.php'' ,内容如下
  <code>define('WP_BACKUP_DIR', 'wp-content/backup-' . $rand);</code>
  <code>define('WP_BACKUP_DIR', 'wp-content/backup-' . $rand);</code>


to something like:
把上边的语句改成这样:
  <code>define('WP_BACKUP_DIR', 'mydir/mysubdir');</code>
  <code>define('WP_BACKUP_DIR', 'mydir/mysubdir');</code>


== 修改 ==


== Modifying ==
===我可以改变Smilies吗?===
 
参见:
===Can I change the Smilies?===
* [[WordPress:Using Smilies|使用Smilies]]
See:
* [[WordPress:Using Smilies]]
 
===How do I edit files?===
See:
* [[WordPress:Editing Files]]
 
===What is ''The Loop''?===
See:
* [[WordPress:The Loop]] and [[WordPress:The Loop in Action]]


===How can I change the URL-structure for my posts?===
===我如何编辑文件?===
See:
参见:
* [[WordPress:Using Permalinks]]
* [[WordPress:Editing Files|编辑文件]]
===什么是'' Loop''?===
参见:
* [[WordPress:The Loop|Loop]] 和 [[WordPress:The Loop in Action|运行中的Loop]]


===How can I change URL-structure for my posts on a Windows server?===
===我如何改变我的文章中的URL结构?===
See:
参见:
* [[WordPress:Using_Permalinks#Using_Permalinks_Without_mod_rewrite|Using Permalinks Without mod rewrite]]
* [[WordPress:Using Permalinks|使用Permalink]]
===我如何改变Windows 服务器上的文章中的URL结构?===
参见:
* [[WordPress:Using_Permalinks#Using_Permalinks_Without_mod_rewrite|使用不带有mod 重写的 Permalink]]
===我如何使用WordPress 模板标签来更改blog上显示的内容?===
参见:
* [[WordPress:Template Tags|模板标签]]


===How do I use WordPress Template Tags to change what is displayed on the blog?===
===我如何让''所有'' 链接都在新窗口中打开?===
See:
把下边的语句放到你的主题的[[WordPress:Using_Themes#Theme_Files|template header.php]]文件的<tt><head></tt>部分:
* [[WordPress:Template Tags]]
 
===How do I get ''All'' links to open in a new window?===
Put this inside the <tt><head></tt> section of your Theme's [[WordPress:Using_Themes#Theme_Files|template header.php]] file:
  <tt><base target="_blank" /></tt>
  <tt><base target="_blank" /></tt>


See:
参见:
* [[WordPress:Using Themes]]
* [[WordPress:Using Themes|使用主题]]
* [http://www.w3schools.com/tags/tag_base.asp W3 Schools base tag explanation]
* [http://www.w3schools.com/tags/tag_base.asp W3 Schools base tag explanation]
===我如何添加图片到我的RSS feed?===
参见:
* [http://wordlog.com/archives/2004/08/01/add-an-image-to-your-rss-20-field/ 添加图片到wordlog.com 的RSS 2.0 feed]


===How can I add an image to my RSS feed?===
===我如何阻止我自己的评论被邮寄给我?===
See:
'''WordPress 1.2版本'''
* [http://wordlog.com/archives/2004/08/01/add-an-image-to-your-rss-20-field/ Add an image to your RSS 2.0 feed at wordlog.com]
如果你发表回帖时使用的邮件地址和这个文章的作者邮件地址相同的话将会阻止WP给你发送邮件 (通知邮件发送的地址). 这只能用于版本1.2 / 1.2.1 。


===How can I stop my own comments being mailed to me?===
在functions.php文件中更改如下代码:
'''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:
  <tt>if ('' == $user->user_email) return false; // If there's no email to send the comment to</tt>
  <tt>if ('' == $user->user_email) return false; // If there's no email to send the comment to</tt>
to
to
  <tt><small>if ('' == $user->user_email || $comment->comment_author_email == $user->user_email) return false; // If there's no email to send the comment to</small></tt>
  <tt><small>if ('' == $user->user_email || $comment->comment_author_email == $user->user_email) return false; // If there's no email to send the comment to</small></tt>
===如果我关闭评论,blog上显示"Comments Off" ,如何才能更改成这样?===
要想把评论功能关闭:


===If I turn off comments, it says "Comments Off" on the weblog. so how do I change that?===
'''WordPress 1.2版本'''
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'''
: wp-includes/template-functions-comment.php 文件的第58行有'Comments Off'


:Line 98 of wp-includes/template-functions-comment.php has the words 'Comments Off'
'''WordPress 1.3版本'''


===How do I change what is shown when I password protect a post?===
:wp-includes/template-functions-comment.php文件的98行有'Comments Off'
To create password protected text, see Line 19 of wp-includes/template-functions-post.php for that information.
===当我使用密码保护某文章时,我如何改变显示内容呢?===
要创建密码保护文本, 查看wp-includes/template-functions-post.php 文件的19行可以找到更多信息。


===How can I allow certain HTML tags in my comments?===
===我如何在评论中允许特定的HTML标签?===
'''WordPress versions prior to 1.2'''
'''WordPress 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.
如果你想不考虑kses.php 文件中$allowedtags 的数量,你可以在my-hacks.php文件中达到目的, 建立$allowedtags数组之后,添加如下代码.
  <tt>define('CUSTOM_TAGS', true);</tt>
  <tt>define('CUSTOM_TAGS', true);</tt>


===How can I add advanced search ability to WordPress?===
===我如何添加高级搜索功能到WordPress?===
See:
参见:
*[http://weblogtoolscollection.com/archives/2004/06/07/advanced-contextual-search-for-wordpress/ Advanced Contextual Search for Wordpress at Weblog Tools Collection]
*[http://weblogtoolscollection.com/archives/2004/06/07/advanced-contextual-search-for-wordpress/ Wordpress博客工具集合高级上下文搜索]


==Posts==
==Posts==


===How do I upload an image and display it in a post?===
===我如何上传图片并让它在某个文章中显示?===
 
To permit images to be uploaded to your site:
 
*From the [[WordPress:Miscellaneous_Options_SubPanel#Allow_File_Uploads|Administration Panel->Options->Miscellaneous]]
**Select the option to '''Allow File Uploads'''
*If you need help with finding the absolute path, visit [[WordPress:Glossary#Absolute Path|Absolute Path]]
*If you need help with changing permissions, visit [[WordPress:Changing_File_Permissions]]
 
*Then check main menu across the top. Click '''Upload'''
 
Refer to the following articles to align the image in the post:
*[http://www.mfr.f2s.com/graphicalcss/align/index.html How to properly aligning the images]
*[http://weblogtoolscollection.com/archives/2004/04/12/image-alignment-drop-shadows/ How to create a drop-shadow effect, with alignment]
* [http://wordpress.org/support/topic/9815 WordPress Support Forum Article]
 
See:
*[[WordPress:Using Images]]
*[[WordPress:Photoblogs and Galleries]]
*[[WordPress:Wrapping Text Around Images]]
 
===What is pingback?===
See:
* [[WordPress:Introduction_to_Blogging#Pingbacks|Introduction to Blogging, Pingbacks]]
 
===What is trackback?===
See:
* [[WordPress:Introduction_to_Blogging#Trackbacks|Introduction to Blogging, Trackbacks]]


===Where is the permalink to my post?===
要想允许上传文件到你的站点:
See:
* [[WordPress:Linking Posts Pages and Categories|Linking Posts, Pages, and Categories]]


===Can I use desktop blogging software?===
*找到[[WordPress:Miscellaneous_Options_SubPanel#Allow_File_Uploads|Administration Panel->Options->Miscellaneous]]操作面板
See
**选中 '''Allow File Uploads'''
*[[WordPress:Weblog Client]]
*如果你需要找到绝对路径的帮助,参见[[WordPress:Glossary#Absolute Path|绝对路径]]
*如果你需要更改许可的帮助信息,参见[[WordPress:Changing_File_Permissions|更改文件许可]]


===Can I blog by email?===
*然后检查顶部的主目录,点击 '''Upload'''
See
查阅如下文章,在你的文章中排列图片::
*[[WordPress:Blog by Email]]
*[http://www.mfr.f2s.com/graphicalcss/align/index.html 如何适当的排列图片]
*[http://weblogtoolscollection.com/archives/2004/04/12/image-alignment-drop-shadows/ 如何创建一个阴影效果]
* [http://wordpress.org/support/topic/9815 WordPress 支持论坛文档]


== Spam, Spammers, Comments ==
参见:
===What can I do to stop comment spam?===
*[[WordPress:Using Images|使用图片]]
See:
*[[WordPress:Photoblogs and Galleries| Photoblogs and Galleries]]
* [[WordPress:Combating Comment Spam]]
*[[WordPress:Wrapping Text Around Images|图片周围的文字]]
===什么是pingback?===
参见:
* [[WordPress:Introduction_to_Blogging#Pingbacks| Blogging介绍之Pingback]]
===什么是trackback?===
参见:
* [[WordPress:Introduction_to_Blogging#Trackbacks| Blogging介绍之Trackbacks]]
===我的文章的permalink 在哪?===
参见:
* [[WordPress:Linking Posts Pages and Categories|链接文章,页面和分类]]
===我可以使用桌面blogging 软件吗?===
参见:
*[[WordPress:Weblog Client|weblog客户端]]
===我可以用邮件写blog吗?===
参见
*[[WordPress:Blog by Email|通过邮件写blog]]


===More Information on Comment Spam===
== 垃圾信息, 发送垃圾信息的人, 评论 ==
See:
===如何才能阻止评论垃圾信息?===
* [[WordPress:Comment Spam]]
参见:
* [[WordPress:Combating Comment Spam|与评论垃圾信息做斗争]]


===What Spam words do I need?===
===有关评论垃圾信息的更多信息===
See:
参见:
* [[WordPress:Spam Words]]
* [[WordPress:Comment Spam|评论垃圾信息]]


===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 [[WordPress:Discussion_Options#Comment_Moderation|Administration Panel->Options -> Discussion]]. It probably has either a single character, OR a blank line OR extra whitespace. Take those out.
参见:
* [[WordPress:Spam Words|垃圾信息词汇]]
===为什么所有的评论必须要审核?===
如果你把所有的评论都发送审核,而实际上并不需要的话,很可能你[[WordPress:Discussion_Options#Comment_Moderation|Administration Panel->Options -> Discussion]]中的'''垃圾信息词汇''' 列表只有一个字或者一个空行或者几个空格,把他们删除。


Right click in the Spam Words box, Select All then Copy and paste it into Notepad to check it.
右键单击Spam Words 框,选择所有,复制并粘贴到记事本来查看.


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 :)
仔细检查 :)


== Importing and Exporting ==
== 导入和导出 ==
===How do I Import a WordPress WXR file when it says it is too large to import?===
===当提示我说文件太大而无法导入的时候,我如何导入WordPress WXR 文件?===
If a WordPress WXR file, an xml file exported from WordPress, is too large to import, there are several things you might try to overcome that limit.   
如果从WordPress 导出的WordPress WXR 文件, xml文件, 太大而无法导入, 有几种方法你可以尝试下以克服这个限制.   
*Break the WordPress WXR file into smaller pieces by separating the data between a post and pasting the header into each file.
*通过在一个文章中把数据分开成几个小文件,把头部信息放到每个文件中,这样把 WordPress WXR 文件拆分成几个小的部分.
*Increase the PHP memory limit in php.ini by changing the memory_limit setting (e.g. <tt>memory_limit = 64M ;</tt>) Note: many hosts don't allow this.
*在php.ini文件中,通过更改内存限制设置把PHP 内存限制提高, (e.g. <tt>memory_limit = 64M ;</tt>) 注意: 很多主机不允许这样.
*Increase the PHP memory limit via .htaccess (e.g. <tt>php_value memory_limit 64M</tt>).  Note: many hosts don't allow this.
*通过 .htaccess文件提高PHP内存限制 (e.g. <tt>php_value memory_limit 64M</tt>).  注意: 很多主机不允许这样.
*Increase the PHP memory limit via wp-config.php (e.g. <tt>define('WP_MEMORY_LIMIT', '64MB');</tt>)
*通过 wp-config.php文件提高PHP内存限制(e.g. <tt>define('WP_MEMORY_LIMIT', '64MB');</tt>)
<!-- not confirmed this works *Increase the PHP post_max_filesize setting in php.ini.  Note: many hosts don't allow this. -->
<!-- not confirmed this works *Increase the PHP post_max_filesize setting in php.ini.  Note: many hosts don't allow this. -->


See:
参见:
* [[WordPress:Importing Content]]
* [[WordPress:Importing Content|导入内容]]
* [[WordPress:Editing_wp-config.php#Increasing_memory_allocated_to_PHP|Editing wp-config.php]]
* [[WordPress:Editing_wp-config.php#Increasing_memory_allocated_to_PHP|编辑 wp-config.php]]


[[WordPress:FAQ|Back to FAQ]]
[[WordPress:FAQ|Back to FAQ]]
[[WordPress:FAQ|返回FAQ]]

2008年5月27日 (二) 10:44的最新版本

导航: 上一级 | WordPress | 首页 | WordPress中文论坛 | WordPress主机 | CMS程序 | 论坛程序 | ECShop | ShopNC | PowerEasy

返回FAQ

管理[ ]

我的文章可以有标题而不是 /index.php?p=76?[ ]

参见:

如果我有mod_rewrite我如何找出?[ ]

要想得到关于你的服务器的信息,你可以使用PHP Info 功能:

  • 把下边语句粘贴到一个新的记事本 / BBEdit 文件中
<?php phpinfo(); ?>
  • 另存为 info.php
  • 上传到服务器. 在浏览器中访问 (www.example.com/info.php)

浏览器会显示出关于你的php 版本和 mod_rewrite的信息.

info.php文件返回一个列出你的PHP安装详细信息的页面. 你可以查看是否mod_rewrite 被载入. 在apache页眉下面, 查看Loaded Modules 部分,可以看到是否mod_rewiite 列出.

我如何改变文件和文件夹许可?[ ]

参见:

为什么版本号不是按照任何特定的周期序列?[ ]

WordPress更新版本的版本号WordPress 可能不是按照某个严格的不变的或者是周期数字排列(或者是测试版的按字母顺序排列), 因为版本号反应出了相关程序, 现有或者前版本的改变。这样,如,因为版本1.2主要是修正版本1.0 (大约是60% 的代码经过改动), 1.1 就被 ’跳过’了。


我如何打开Permalinks, 我该如何处理错误?[ ]

参见:

用户等级有什么用不同的等级有什么权限?[ ]

参见:

wp-config.php644权限会危及在我的共享服务器上的其他用户的用户名和密码吗?[ ]

这是一个PHP 在你的服务器上安装时的局限. 如果你以前使用了MovableType, 带有suexec 的Perl 可能已经安装,这样 Movable Type 作为你的使用者来执行. 在这种情况下, PHP 作为服务器用户运行。这就是为什么必须至少是 444. 有一个phpsuexec但是似乎很多主机都不使用它.

尽管如此,这通常在现代共享主机上不是什么问题,因为文件是随便阅读的,但是每个帐户建立时带有“jailshell" ,保证人们被锁在自己的目录中, PHP 还可以轻易的使用 open_basedir进行约束,保证人们不能改写PHP脚本来阅读你的文件. 如果你实在需要,你可以联系主机,看看可以采取什么措施。


用户登陆后我如何重定向用户回到我的blog主页?[ ]

安装插件,From where you came, 如果你的用户从主页点击了Log in 链接,他们就会在登陆后被直接返回。

我如何为我的文件改变权限,这样我可以使用模板编辑器编辑它们?[ ]

参见:

我如何防止我的图片被别的站点做成热链接?[ ]

你可以使用你的.htaccess文件来保护图片不被热链接, 或者, 换句话说, 被别的网站链接到了. 这可能会影响你的带宽,因为如果某人直接链接到你的站点上的图片,你就失去了这部分带宽。

Clockwatchers的htaccess 图片指导 给出了更多详细内容.

你可以使用这个工具来查看是否图片被适当的保护,这也有几个额外的小提示。

要想得到对付热链接的更好的办法请查看A List Apart's Smarter Image Hotlinking Prevention.

我如何使用phpMyadmin备份和恢复我的WordPress数据库?[ ]

参见:

我如何阻止灌水?[ ]

灌水是当很多的回帖(可能是垃圾信息)在很短的一个持续时间段在你的站点上同时出现。 Mark Ghosh's的文章, 阻止灌水-一个非常简单的解决方法, 以及相关的组织灌水hack, 允许你设置一个每两个贴之间的时间间隔,可以防止回帖太快。

代码修改的一个附件如下 (适用WP 1.2) :

在wp-comments-post.php (在回帖中间,你应该找到合适的地方), 加入如下代码:

// 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.’) );
}

为什么我不能删除未分类的分类?[ ]

任何Administration > Manage > Categories# of Posts 值不为零的分类不能 被删除. 未分类的 分类必然指向某个文章,但是所有 页面 指向这个未分类的 分类.这样尽管可能没有文章指向这个未分类的 分类,页面还是包含在 # of Posts的记录当中。

默认的分类不能被删除,即使它是空的,尽管如此你可以在管理面板中的Options - Writing为你的帖子或者链接指定你的默认分类。

为什么写或者编辑页面时没有页面模板操作?[ ]

如果写或者编辑页面时没有页面模板操作,可能是因为没有 带有合适结构的模板文件。 为了让页面模板框可用来分配 页面,你的主题中必须至少有一个模板文件,在模板文件开头的地方拥有如下代码:

<?php
/*
Template Name: Links
*/
?>

这个例子来自WordPress 默认主题wp-content/themes/default/links.php file.

参见:

页面模板

配置[ ]

我如何才能改变日期/ 或者时间如何显示?[ ]

参见:

我如何控制别人的评论?[ ]

参见:

Discussion Options 意味着什么?[ ]

参见:

我如何安装插件?[ ]

参见:

当我建立不止一个分类的时候,我如何才能更改分类之间的外观?[ ]

要想设定分类的显示, 打开index.php文件然后找到 <div class meta>. 你会看到如下代码:

<?php the_category() ?>

圆括号( ) 和引号之内, 添加或者更改来得到你想要的新界面.

如果你想让分类中间是逗号,标签如下:

<?php the_category(',') ?>

如果你想要箭头,标签如下:

<?php the_category(' > ') ?>

如果你想要分隔符,标签如下:

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

如果你想要"竖线", ( | ) 标签如下:

<?php the_category(' | ') ?>

运用你的想象力和创造力,让分类之间的分隔以你喜欢的方式呈现出来。

为什么所有的评论必须审核?[ ]

找到Options > Discussion面板确定An administrator must approve the comment (regardless of any matches below) 是未选中状态. 如果选中这个选项, 所有的评论会被发送到队列中以等待审核。确认Hold a comment in the queue if it contains more than x links 是非空的,包含一个大于零的数字。如果这个值是空白或者零,所有的评论包含的链接都会被调整。如果上面提到的操作都是未选中的,链接调整值大于零,你还会碰到问题, 你的 垃圾信息词语 列表信息中可能会有空行,标点或者单一的字母。在列表项目之间必须有空格或者每个项目必须在它自己的那一行中。如果你完成这些后,然后更新一下你安装的评论垃圾信息插件。如果问题仍然存在,一个一个的禁用评论垃圾信息插件来确定问题出在哪里,联系插件作者寻求帮助。

如何阻止别人发布HTML 评论?[ ]

是否允许评论区域的HTML 标签由kses.php文件管理,该文件在wp-includes 文件夹中。

使用文本编辑器打开这个文件, 把HTML 标签列表定位在文件顶部。每个HTML 标签都列在一个单独的行,在允许的标签中的一个PHP数组结构中。以// 开头的行都是commented-out, 或者是禁用的。所以以//开始的指定的HTML标签都是 允许出现在评论中的。

要想阻止人们在评论中添加HTML, 编辑你的 kses.php 文件,按照你想要的,允许或者不允许特定的HTML标签出现在评论中,可以通过添加//到列表的适当的行的最前面实现。 要想阻止所有的HTML标签, 就注释掉所有允许HTML标签的行. 确认完成后保存文件。

注意如果你可以删除这些行的话,最好还是用注释掉来代替删除, 通过在每行开始的地方添加//来达到相同的结果,这样可以确保将来可能想重新激活这些标签。

我如何禁用评论?[ ]

首先,在Options > Discussion 面板上不要勾上Allow people to post comments on the article . This will only disabled comments on future posts.现在,为了完全的不能让别人评论,你将在写文章的子面板上的编辑过的每篇文章上不要勾上Allow Comments 或者,你可以在shell帐户的命令行上运行MYSQL查询或者使用WordPress:phpMyAdmin: UPDATE wp_posts SET comment_status="closed";

如果你的目标是让人永久的不能评论,你该删除wp-comments-post.php文件


我该如何禁用trackbacks 和pingbacks?[ ]

首先在 Options > Discussion 面板中,取消选中Allow link notifications from other Weblogs (pingbacks and trackbacks.). 这只是在将来的文章中禁用了trackbacks 和 pingbacks 。现在,完全禁用trackbacks 和 pingbacks,你将不得不编辑每个过去的文章并且从Write Post子面板取消选中Allow Pings 作为选择,在一个外壳账号上从命令行运行 MySQL 查询或者使用PHPMyAdmin: UPDATE wp_posts SET ping_status="closed";

如果你的目标是永远禁用trackbacks 和pingbacks, 那么你还应该删除 wp-trackback.php 文件。

我如何禁用 RSS 或者是 syndicated feeds?[ ]

想禁用RSS 或 syndicated feeds, 你必须删除wp-atom.php, wp-commentsrss2.php, wp-feed.php, wp-rdf.php, wp-rss.php, 和 wp-rss2.php文件。

我如何更改 站点管理 的名字?[ ]

要想改变你的管理名字,在Administration Panel中,选择 Users->Your Profile 标签. 在这里进行更改。尽管如此,你不能在管理面板中更改用户名 。为了更改名字你必须直接编辑 MySQL 数据库。尽管如此,建议不要该你的用户名,因为别人并不能经常看见你的名字。

参见:

我如何找到所需的绝对路径上传图片?[ ]

为了找到一个页面的绝对路径,absolutepath.zip 可以帮助你。下载,解压缩,上传到page / image / directory 的位置,然后在浏览器中浏览文件 - http://www.example.com/images/absolutepath.php

我可以改变哪个文件来替换我的blog外观?[ ]

以下几个文件影响你的站点的外观, 通过管理界面的Templates操作里的内建编辑器,每一个都可以很容易的做出改动:

   * index.php
     影响内容的版面.
   * style.css
     控制你的blog的样式和界面.
   * wp-comments.php
     这个控制用户提交注释和trackbacks,还有评论提交的版面 .
   * wp-comments-popup.php
     只有当你决定使用 popup comments box.的时候才需要
     (Popup comments 默认时是关闭的).

我能拥有popup comments吗?[ ]

想要激活popup comments, 根据你使用的WordPress版本选择合适的方法.

WordPress 2.0版本默认主题header.php 内加入该行:

<?php comments_popup_script(); ?>

添加在下面这行之上:

<?php wp_head(); ?>

例如:

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

WordPress 2.0 经典主题

在文件header.php中找到这行 (第21行):

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

然后删除第一个注释标记,更改为:

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


WordPress 1.5版本默认主题

header.php 添加 该行:

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

在下面这行代码之下:

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

例如:

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

WordPress 1.5 版本经典主题

header.php内有如下这行代码:

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

更改为

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

WordPress 1.2版本

index.php 内有如下这行代码:

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

更改为

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

我如何上传图片?[ ]

要想允许上传图片到你的站点:

从管理面板中找到Options -> Miscellaneous

  • 选择Allow File Uploads
    • 如果你需要找到绝对路径的帮助信息,参见 [[WordPress:#How_do_I_find_the_absolute_path_I_need_for_uploading_images.3F|我如何找到所需的绝对路径上传图片?]].
    • 如果你需要更改许可的帮助信息,参见 更改文件许可.
  • 然后查看顶部的主目录,点击Upload
  • Wordpress 2.0中,找到Write -> Write Post 或者 Write -> Write Page 然后使用其中的上传界面。

我可以改变WordPress Database Plugin 把备份保存在那吗?[ ]

通常(到WordPress 2.0为止) WordPress Database Plugin 把备份保存在文件夹 wp-content/backup-xxxxxx (xxxxxx 是一个随机生成的序列号). 想改变使用的文件夹,改变wp-db-backup.php 文件就可以了.

在WordPress Database Plugin版本1.7,你可以改变第22行的 wp-db-backup.php ,内容如下

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

把上边的语句改成这样:

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

修改[ ]

我可以改变Smilies吗?[ ]

参见:

我如何编辑文件?[ ]

参见:

什么是 Loop?[ ]

参见:

我如何改变我的文章中的URL结构?[ ]

参见:

我如何改变Windows 服务器上的文章中的URL结构?[ ]

参见:

我如何使用WordPress 模板标签来更改blog上显示的内容?[ ]

参见:

我如何让所有 链接都在新窗口中打开?[ ]

把下边的语句放到你的主题的template header.php文件的<head>部分:

<base target="_blank" />

参见:

我如何添加图片到我的RSS feed?[ ]

参见:

我如何阻止我自己的评论被邮寄给我?[ ]

WordPress 1.2版本 如果你发表回帖时使用的邮件地址和这个文章的作者邮件地址相同的话将会阻止WP给你发送邮件 (通知邮件发送的地址). 这只能用于版本1.2 / 1.2.1 。

在functions.php文件中更改如下代码:

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

如果我关闭评论,blog上显示"Comments Off" ,如何才能更改成这样?[ ]

要想把评论功能关闭:

WordPress 1.2版本

wp-includes/template-functions-comment.php 文件的第58行有'Comments Off'

WordPress 1.3版本

wp-includes/template-functions-comment.php文件的98行有'Comments Off'

当我使用密码保护某文章时,我如何改变显示内容呢?[ ]

要创建密码保护文本, 查看wp-includes/template-functions-post.php 文件的19行可以找到更多信息。

我如何在评论中允许特定的HTML标签?[ ]

'WordPress 1.2及以前版本

如果你想不考虑kses.php 文件中$allowedtags 的数量,你可以在my-hacks.php文件中达到目的, 建立$allowedtags数组之后,添加如下代码.

define('CUSTOM_TAGS', true);

我如何添加高级搜索功能到WordPress?[ ]

参见:

Posts[ ]

我如何上传图片并让它在某个文章中显示?[ ]

要想允许上传文件到你的站点:

  • 然后检查顶部的主目录,点击 Upload

查阅如下文章,在你的文章中排列图片::

参见:

什么是pingback?[ ]

参见:

什么是trackback?[ ]

参见:

我的文章的permalink 在哪?[ ]

参见:

我可以使用桌面blogging 软件吗?[ ]

参见:

我可以用邮件写blog吗?[ ]

参见

垃圾信息, 发送垃圾信息的人, 评论[ ]

如何才能阻止评论垃圾信息?[ ]

参见:

有关评论垃圾信息的更多信息[ ]

参见:

我需要什么样的垃圾信息词汇?[ ]

参见:

为什么所有的评论必须要审核?[ ]

如果你把所有的评论都发送审核,而实际上并不需要的话,很可能你Administration Panel->Options -> Discussion中的垃圾信息词汇 列表只有一个字或者一个空行或者几个空格,把他们删除。

右键单击Spam Words 框,选择所有,复制并粘贴到记事本来查看.

添加垃圾信息插件到列表中后, 查看临时数据变的不那么简单了,而且很容易忽略多个空行。 这样会让审核变的容易些。

仔细检查 :)

导入和导出[ ]

当提示我说文件太大而无法导入的时候,我如何导入WordPress WXR 文件?[ ]

如果从WordPress 导出的WordPress WXR 文件, xml文件, 太大而无法导入, 有几种方法你可以尝试下以克服这个限制.

  • 通过在一个文章中把数据分开成几个小文件,把头部信息放到每个文件中,这样把 WordPress WXR 文件拆分成几个小的部分.
  • 在php.ini文件中,通过更改内存限制设置把PHP 内存限制提高, (e.g. memory_limit = 64M ;) 注意: 很多主机不允许这样.
  • 通过 .htaccess文件提高PHP内存限制 (e.g. php_value memory_limit 64M). 注意: 很多主机不允许这样.
  • 通过 wp-config.php文件提高PHP内存限制(e.g. define('WP_MEMORY_LIMIT', '64MB');)

参见:

Back to FAQ 返回FAQ