WordPress: FAQ Troubleshooting:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: Back to FAQ __TOC__ <div style="clear:both"> </div> ==Why can't I see my posts? All I see is ''Sorry, no posts match your criteria''?== Clearing your browser cache and cookies ...)
 
无编辑摘要
第1行: 第1行:
[[FAQ|Back to FAQ]]
[[Wordpress:FAQ|Back to FAQ]]
__TOC__
__TOC__
<div style="clear:both">
<div style="clear:both">
</div>
</div>


==Administration==
===Can my posts have titles instead of  /index.php?p=76?===
See:
* [[Wordpress:Using Permalinks]]


==Why can't I see my posts? All I see is ''Sorry, no posts match your criteria''?==
===How can I find out if I have mod_rewrite?===
To get information about your server, you can use the PHP Info function:


Clearing your browser cache and cookies may resolve this problem.  Also, check your <tt>search.php</tt> and <tt>index.php</tt> template files for errors.
*Paste this into a new Notepad / BBEdit file


See also:
<tt><?php phpinfo(); ?></tt>
 
*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 [[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.
 
===How do I change file and folder permissions?===
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.
 
===How do I turn on Permalinks, and what do I do about the errors?===
See:
* [[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?===
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''?===
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:
<nowiki>$redirect_to = '../index.php';</nowiki>
 
===How do I change permissions for my files so I can edit them using the Template Editor?===
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.


* [[I Make Changes and Nothing Happens]]
You can use this tool to check if the images are protected properly, and that has a few extra tips too.


==How do I find more help?==
For a more sophisticated method of preventing hotlinking see [http://www.alistapart.com/articles/hotlinking/ A List Apart's Smarter Image Hotlinking Prevention].


There are various resources that will help you find more help with WordPress, in addition to these [[FAQ]].  You can also increase your search capabilities by adding the [http://asymptomatic.net/2005/07/20/1765/codex-searcher/ Codex and Forum Searcher Plugin] and search both the Codex and Forum from your WordPress Administration Panels. Click on one of the search results and the page will open in a new window or tab so you can have the article or discussion open while working on WordPress.
===How do I backup and restore my WordPress database using phpMyadmin?===
See:
* [[Wordpress:Backing Up Your Database]] and [[Wordpress:Restoring Your Database From Backup]]


* [[Troubleshooting]]
===How do I prevent comment flooding?===
* [[Finding WordPress Help]]
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.
* [[Using the Support Forums]]
* [[Technical Articles|Resources and Technical Articles about WordPress]]
* [[Troubleshooting#Installation_Problems|Installation Problems]]


===Where can I find help with the CSS problems I'm having?===
A copy of the code modification is given below (this is for WP 1.2) :


The following are articles that will help you troubleshoot and solve many of your [[CSS]] problems:
In wp-comments-post.php (between the comments, you should recognize the place), add the following:


* [[Blog Design and Layout]]
// Simple flood-protection
* [[Finding Your CSS Styles]]
$lasttime = $wpdb->get_var("SELECT comment_date FROM $tablecomments ORDER BY comment_date DESC LIMIT 1&#8243;);
* [[CSS Fixing Browser Bugs]]
if (!empty($lasttime)) {
* [[CSS Troubleshooting]]
$time_lastcomment= mysql2date(’U', $lasttime);
* [[CSS|WordPress CSS Information and Resources]]
$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 does the password emailed to me look weird?==
===Why can't I delete the ''uncategorized'' Category?===
If the password emailed to you looks strange, see [http://allnarfedup.com/2004/11/10/solving-garbled-text/ Solving Garbled Text].
Any Category with a non-zero value for ''# of Posts'' in the [[Wordpress:Administration Panels|Administration]] >
[[Wordpress:Administration_Panels#Manage_-_Change_your_content|Manage]] > [[Wordpress:Manage_Categories_SubPanel|Categories]] '''cannot''' be deleted.  The ''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''.


==How to fix my site statistics problem on a WordPress 2.x blog hosted at Dreamhost?==
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.


Dreamhost has a kb/wiki post about this called, [http://wiki.dreamhost.com/index.php/Making_stats_accessible_with_htaccess Making stats accessible with htaccess].
===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:


==Why do I get an error message about ''Sending Referrers''?==
<pre>
If you got this message when trying to save a post, consider checking [[Administration_Panels|Administration]] > [[Administration_Panels#General|Options]] > [[General_Options_SubPanel|General]] and make sure both your '''WordPress address (URI)'''  and the '''Blog address (URI)''' do not use 'www'.  For example, instead of '''<nowiki>http://www.sample.com</nowiki>''' use '''<nowiki>http://sample.com</nowiki>''' in those fields. This information orginally reported via http://wordpress.org/support/topic/72235
<?php
/*
Template Name: Links
*/
?>
</pre>
 
That example is from the WordPress Default themes wp-content/themes/default/links.php file.


See also:
See also:
* [[Enable Sending Referrers]]


==Are there are any problems with using MySQL 4.1.7 for WordPress?==
[[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?===
See:
* [[Wordpress:Comment Moderation]]
 
===What do the Discussion Options mean?===
See:
* [[Wordpress:Discussion Options]]
 
===How do I install plugins?===
See:
* [[Wordpress:Managing Plugins]]


See  [[FAQ_Installation#Can_I_install_WordPress_on_Windows_2000.3F|Can I install WordPress on Windows 2000?]]
===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:


==How do I empty a database table?==
<tt><?php the_category() ?></tt>
See  also:
* [[Emptying a Database Table]]


==How do I fix the following error ''SQL/DB Error errcode 13 Can't create/write to file''?==
Inside of the parentheses '''( )''' and quote marks, add or change this to reflect the new look you desire.
'''Problem:''' The MySQL variable <tt>tmpdir</tt> is set to a directory that cannot be written to when using PHP to access MySQL.


To verify this, enter MySQL at the command line and type <tt>show variables</tt>;
If you would like to have commas between the categories, the tag should read:


You'll get a long list and one of them will read: '''tmpdir = /somedir/''' (whatever your setting is.)
<tt><?php the_category(',') ?></tt>


'''Solution:''' Alter the '''tmpdir''' variable to point to a writable directory.
If you would like to have an arrow, the tag would look like this:


'''Steps:'''
<tt><?php the_category(' > ') ?></tt>
<ol>
<li>Find the '''my.cnf''' file. On *nix systems this is usually in '''/etc/'''.</li>
<li>Once found, open this in a simple text editor and find the '''[mysqld]''' section.</li>
<li>Under this section, find the '''tmpdir''' line. If this line is commented (has a '''#''' at the start), delete the '''#''' and edit the line so that it reads: '''tmpdir = /writable/dir''' where '''/writable/dir''' is a directory to which you can write. Some use '''/tmp''', or you might also try '''/home//'''.
</li>
<li>Save the file.</li>
<li>Shutdown MySQL by typing <tt>mysqlshutdown -u -p shutdown</tt>.</li>
<li>Start MySQL by going to the MySQL directory and typing <tt>./bin/safe_mysqld &</tt>. Usually the MySQL directory is in '''/usr/local''' or sometimes in '''/usr/''' on Linux systems.
</li>
</ol>
If none of this make sense and you have someone to administrate your system for you, show the above to them and they should be able to figure it out.


==How do I solve the ''Headers already sent'' warning problem?==
If you would like to have a bullet, the tag would look like this:


'''Description:''' You get a warning message on your browser that says:
<tt><?php the_category(' &amp;bull; ') ?></tt>


<tt>Warning: Cannot modify header information - headers already sent by
If you would like the "pipe" ( | ) between the categories, the tag would look like this:
(output started at</tt>


'''Reason and Solution :'''
<tt><?php the_category(' | ') ?></tt>


It is usually because there are spaces, new lines, or other garbage
Use your imagination and creativity to make the separations in the categories look any way you like.
before an opening '''<tt><?php</tt>''' tag or after a closing '''<tt>?></tt>''' tag, typically in
'''wp-config.php'''. This could be true about some other file too, so please check the error message, as it will list the specific file name where the error occurred (see "Interpreting the Error Message" below).  Replacing the faulty file with one from your most recent backup or one from a fresh WordPress download is your best bet, but if neither of those are an option, please follow the steps below.


Just because you cannot see anything does not mean that PHP sees the same.
===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.


# Download the file mentioned in the error message.
===How do I stop people from posting HTML in comments?===
# Open that file in a [[Glossary#Text editor|plain text editor]] ('''NOT''' MS Word or similar. Notepad or BBEdit are fine).
# Check that the ''very'' first characters are '''<tt><?php</tt>'''
# Check that the ''very'' last characters are '''<tt>?></tt>'''


To be sure about the end of the file, do this:
Acceptance of HTML tags in the comments field is managed in the file '''kses.php''', located in the '''wp-includes''' folder.
#Place the cursor between the ? and >
#Now press the DELETE key on your computer
#*Note to MAC users: The "DELETE" key on a PC deletes characters to the ''right'' of the cursor.  That is the key noted here.
#Keep that key pressed
#For at least 15 seconds
#Now type > and
#'''save''' without pressing any other key at all.
#If you press another key, you will bring the problem back.


'''Interpreting the Error Message:'''
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.


If the error message states: <code>Warning: Cannot modify header information - headers already sent by (output started at /path/blog/wp-config.php:34) in /path/blog/wp-login.php on line 42</code>, then the problem is at line #34 of <code>wp-config.php</code>, not line #42 of <code>wp-login.php</code>.  In this scenario, line #42 of <code>wp-login.php</code> is the victim.  It is being affected by the excess whitespace at line #34 of <code>wp-config.php</code>.
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.


If the error message states: <code>Warning: Cannot modify header information - headers already sent by (output started at /path/wp-admin/admin-header.php:8) in /path/wp-admin/post.php on line 569</code>, then the problem is at line #8 of <code>admin-header.php</code>, not line #569 of <code>post.php</code>.  In this scenario, line #569 of <code>post.php</code> is the victim.  It is being affected by the excess whitespace at line #8 of <code>admin-header.php</code>.
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.


==Why can't I see the visual rich editor when using Apple's Safari browser?==
===How do I disable comments?===
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>


'''Description:''' The visual rich editor in the Write interface (aka "the WYSIWYG editor") does not display when using Apple's Safari browser.
If your goal is to permanently disable comments, then you should delete the <tt>wp-comments-post.php</tt> file as well.


'''Reason and Solution:'''
===How do I disable trackbacks and pingbacks?===
In early versions of Safari, the visual rich editor would cause the browser to crash immediately upon loading the Write interface.  This was due to a bug in Safari, not WordPress.  Since the WordPress developers had no way of correcting this, they chose to disable the visual rich editor for Safari users.  At this point in time, there are three alternatives for affected users.  One could '''upgrade to Safari 3.0.4 or higher and WordPress 2.3 or higher''', use [http://www.mozilla.com/firefox/ Firefox] or [http://caminobrowser.org/ Camino], or de-select "Users should use the visual rich editor by default" in [[Administration_Panels|Administration]] > [[Administration_Panels#Writing|Options]] > [[Writing_Options_SubPanel|Writing]] and install [http://wordpress.org/extend/plugins/deans-fckeditor-for-wordpress-plugin/ Dean's FCKEditor For WordPress].
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>


==Why can't I see the Quicktag buttons when using Apple's Safari browser?==
If your goal is to permanently disable trackbacks and pingbacks, then you should delete the <tt>wp-trackback.php</tt> file as well.


'''Description:''' The Quicktag buttons in the Write interface do not display when using Apple's Safari browser.
===How do I disable my RSS or syndicated feeds?===
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.


'''Reason and Solution:'''  
===How do I change the ''site admin'' name?===
In early versions of Safari, the Quicktag buttons would function, but not as intended.  This was due to a bug in Safari, not WordPress.  Since the WordPress developers had no way of correcting this, they chose to disable the Quicktag buttons for Safari users.  At this point in time, there are three alternatives for affected users.  One could '''upgrade to Safari 2.0.4 or higher and WordPress 2.0.7 or higher''', use [http://www.getfirefox.com Firefox] or [http://www.caminobrowser.org/ Camino], or (for earlier versions of WordPress) remove the <tt>if</tt> statement on line 1085 and the word "<tt>else</tt>" on line 1092 of <tt>/wp-admin/admin-functions.php</tt> .
To change your Admin Name, in the [[Wordpress:Administration_Panels|Administration Panel]], choose the '''Users->Your Profile''' tab. Make 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.


For example, change this:
See:
<pre>function the_quicktags() {
* [[Wordpress:Your Profile SubPanel]]
// Browser detection sucks, but until Safari supports the JS needed for this to work people just assume it's a bug in WP
if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Safari'))
echo '
<div id="quicktags">
<script src="../wp-includes/js/quicktags.js" type="text/javascript"></script>
<script type="text/javascript">if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();</script>
</div>
';
else echo '
<script type="text/javascript"></pre>


to this:
===How do I find the absolute path I need for uploading images?===
<pre>function the_quicktags() {
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
// Browser detection sucks, but until Safari supports the JS needed for this to work people just assume it's a bug in WP
echo '
<div id="quicktags">
<script src="../wp-includes/js/quicktags.js" type="text/javascript"></script>
<script type="text/javascript">if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();</script>
</div>
';
echo '
<script type="text/javascript"></pre>


==E-mailed passwords are not being received==
===Which files do I change to alter the way my blog looks?===
'''Description:''' When users try to register with your blog or change their passwords by entering their username and email, WordPress indicates that their password has been emailed to them, but it is never received.
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:


'''Reason and Solution:''' WordPress uses the standard php mail function, which uses sendmail.  No account information is needed. This is not generally a problem if you are using a hosting service, but if you are using your own box and do not have an SMTP server, the mail will never send.  If you are using a *NIX box, you should have either postfix or sendmail on your machine; you will just need to set them up (Google for how-to's).  If you do not want to go through setting up a complete mail server on your *NIX box you may find [http://packages.debian.org/stable/mail/ssmtp ssmtp] useful -- it provides ''"A secure, effective and simple way of getting mail off a system to your mail hub"''.  On a Windows machine, try a sendmail emulator like [http://glob.com.au/sendmail/ Glob SendMail].
    * '''index.php'''
      This affects the layout of your content.


More help can be found on the forums at: http://wordpress.org/support/topic.php?id=24981
    * '''style.css'''
      This is how the style and presentation of your blog is controlled.


As a plugin-based alternative, you could try [http://www.coffee2code.com/archives/2004/06/28/plugin-wpphpmailer/ wpPHPMailer].  It ''"enables WordPress to send e-mail via SMTP instead of via PHP's mail() function (aka sendmail)."''
    * '''wp-comments.php'''
      This controls the layout of user-submitted comments and trackbacks,
      and the comments submission form.


'''Windows Host Specific:''' With the plugin mentioned above you can work around the issue of e-mails not being received.
    * '''wp-comments-popup.php'''
      Only needed if you decide to use a popup comments box.
      (Popup comments are off by default).


Another alternative is to edit the ''class-pop3.php'' file in wp-includes, there is a variable, ''$MAILSERVER'', which allows you to hard code your smtp server.  However, ''wp-php.php'' in the root directory actually loops through depending on the author to determine a value to set the from address on the e-mail and defaults to the admin address particularly in the case of users registering.
===Can I have popup comments?===
To enable popup comments, choose the appropriate method for the version of WordPress you are using.


This is fine if your admin address is a valid e-mail address.  For example, if your admin e-mail is: ''admin@"yourhost.com"'', your smtp server must also be ''smtp."yourhost.com"''.  If the domains do not match your mail will not send.  (Your SMTP server may not require authentication however, your host in most cases still checks to make sure incoming SMTP traffic is still valid.  This is to prevent spam.)
'''WordPress version 2.0 Default Theme'''


When using the plugin wpPHPMailer the same applies, and there is an option to hard code the from address.
Inside '''header.php''' add this line:
<tt><?php comments_popup_script(); ?></tt>


==How do I get the Quicktag <nowiki><!--nextpage--></nowiki> back?==
''above'' this line:
For some reason,  the <nowiki><!--nextpage--></nowiki> Quicktag button was "removed" in 1.5.1. To get it back, just do the following:
<pre><?php wp_head(); ?></pre>


'''In Wordpress 1.5.x'''
For example:


Open ''wp-admin/quicktags.js'' in a text editor and locate this section (starting at line 135):
<pre>
<pre>
/*
<?php comments_popup_script(); ?>
edButtons[edButtons.length] =
<?php wp_head(); ?>
new edButton('ed_next'
</head></pre>
,'page'
 
,'<!--nextpage-->'
'''WordPress 2.0 Classic Theme'''
,''
 
,'p'
In the file '''header.php''' locate this line (line 21):
,-1
<pre><?php //comments_popup_script(); // off by default ?></pre>
);
 
*/
And remove the first comment markers, changing it to this:
</pre>
<pre><?php comments_popup_script(); // off by default ?></pre>
Just remove the /* and */ lines to uncomment the block of code.  That should return the button to your editing windows.
 
'''WordPress version 1.5 Default Theme'''
 
Inside '''header.php''' ''add'' this line:
<tt><?php comments_popup_script(); // off by default ?></tt>
 
''below'' this line:
 
<pre><?php wp_get_archives('type=monthly&format=link'); ?></pre>
 
Example:
 
<pre><?php wp_get_archives('type=monthly&format=link'); ?>
<?php comments_popup_script(); // off by default ?>
<?php wp_head(); ?></pre>
 
'''WordPress version 1.5 Classic Theme'''
 
Inside '''header.php''' is this line:
<tt><?php //comments_popup_script(); // off by default ?></tt>
Change that to
<tt><?php comments_popup_script(); // off by default ?></tt>
 
'''WordPress version 1.2'''
 
Inside '''index.php''' is this line:
<tt><?php //comments_popup_script(); // off by default ?></tt>
Change that to
<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'''
*Select the option to '''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?]].
**If you need help with changing permissions, visit [[Wordpress:Changing_File_Permissions]].
*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
<code>define('WP_BACKUP_DIR', 'wp-content/backup-' . $rand);</code>
 
to something like:
<code>define('WP_BACKUP_DIR', 'mydir/mysubdir');</code>
 
 
== Modifying ==
 
===Can I change the 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]]
 
===How can I change URL-structure for my posts on a Windows server?===
See:
* [[Wordpress:Using_Permalinks#Using_Permalinks_Without_mod_rewrite|Using Permalinks Without mod rewrite]]
 
===How do I use WordPress Template Tags to change what is displayed on the blog?===
See:
* [[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>
 
See:
* [[Wordpress:Using Themes]]
* [http://www.w3schools.com/tags/tag_base.asp W3 Schools base tag explanation]
 
===How can I add an image to my RSS feed?===
See:
* [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]
 
===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:
<tt>if ('' == $user->user_email) return false; // If there's no email to send the comment to</tt>
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>
 
===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' 


'''In Wordpress 2.0.x'''
'''WordPress version 1.3'''


Open ''wp-includes/js/quicktags.js'' in a text editor and locate this section (starting at line 135):
:Line 98 of wp-includes/template-functions-comment.php has the words 'Comments Off'   
<pre>
//
edButtons[edButtons.length] =
new edButton('ed_next'
,'page'
,'<!--nextpage-->'
,''
,'p'
,-1
);
//
</pre>
Just remove the two // lines after and before the block of code to uncomment it.  


Now Open '''wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js'' in a text editor and locate this section (starting at line 15):
===How do I change what is shown when I password protect a post?===
<pre>
To create password protected text, see Line 19 of wp-includes/template-functions-post.php for that information.
var buttons = '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\')" target="_self" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');return false;"><img id="{$editor_id}_wordpress_more" src="{$pluginurl}/images/more.gif" title="'+titleMore+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';
// Add this to the buttons var to put the Page button into the toolbar.
// '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\')" target="_self" onclick="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\');return false;"><img id="{$editor_id}_wordpress_page" src="{$pluginurl}/images/page.gif" title="'+titlePage+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';
</pre>


On line 17 copy the text between the apostrophes and paste it at the end of line 15 exactly before the trailing '; as follows:
===How can I allow certain HTML tags in my comments?===
'''WordPress versions prior to 1.2'''


<pre>
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.
var buttons = '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\')" target="_self" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');return false;"><img id="{$editor_id}_wordpress_more" src="{$pluginurl}/images/more.gif" title="'+titleMore+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a> <a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\')" target="_self" onclick="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\');return false;"><img id="{$editor_id}_wordpress_page" src="{$pluginurl}/images/page.gif" title="'+titlePage+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';
<tt>define('CUSTOM_TAGS', true);</tt>
</pre>


This will show the the Quicktag <nowiki><!--nextpage--></nowiki> again. You can also enable the hotkey access by doing just one more thing. Open '''wp-includes/js/tinymce/plugins/wphelp/editor_plugin.js'' with a text editor. Note that it's not the same file as the one from the previous step, as although it has the same name it is on a different path. Locate the following lines (should be line 23 and 24):
===How can I add advanced search ability to WordPress?===
<pre>
See:
+ '<input type="button" accesskey="t" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');" />'
*[http://weblogtoolscollection.com/archives/2004/06/07/advanced-contextual-search-for-wordpress/ Advanced Contextual Search for Wordpress at Weblog Tools Collection]
+ '<input type="button" accesskey="u" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Undo\',false);" />'
</pre>
Copy line 23, paste it as a new line just below line 23, and edit it as follows:
<pre>
+ '<input type="button" accesskey="t" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');" />'
+ '<input type="button" accesskey="p" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\');" />'
+ '<input type="button" accesskey="u" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Undo\',false);" />'
</pre>
This will enable the Alt+P shortcut for the <nowiki><!--nextpage--></nowiki> tag.


==I used the Quicktag <nowiki><!--nextpage--></nowiki> in a post so why doesn't it work?==
==Posts==
In some [[Using Themes|Themes]], such as the WordPress Classic Theme, you may see the <nowiki><!--nextpage--></nowiki> work properly on your main page, but other [[Using Themes|Themes]], such as the WordPress default Theme,  may only show the ''page break'' when viewing the posts individually.  It may be necessary to change your Theme's [[Templates|template]] ''page.php'' or ''index.php'' file to make this feature work according to your wishes.  You'll need to add the following:
<pre><?php wp_link_pages(); ?> ?</pre>


== MySQL Error 28 ==
===How do I upload an image and display it in a post?===


You get the following error:
To permit images to be uploaded to your site:


Error code 28: No space left on device
*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]]


This is a MySQL error and has nothing to do with WordPress directly; you should contact your host about it. Some users have reported that running a "repair table" command in [[phpMyAdmin]] fixed the problem.
*Then check main menu across the top. Click '''Upload'''


[http://www.mysql.com/newsletter/2003-10/a0000000249.html Error 28, and how to avoid it]:
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]


<pre>
See:
If you get this error, check all filesystems in
*[[Wordpress:Using Images]]
which MySQL operates. If you followed recommendations
*[[Wordpress:Photoblogs and Galleries]]
to split datadir, tmpdir and log files into dedicated
*[[Wordpress:Wrapping Text Around Images]]
filesystems, more than one filesystem is involved. In
addition, be aware that MySQL often creates temporary
tables for some queries. Most of these are placed in
tmpdir; however, some may be found in the database
directory (e.g. ALTER TABLE). Also, ensure that
sufficient free disk space is available for MySQL.
</pre>


It could be because:
===What is pingback?===
* you are out of space on /tmp (wherever tmpdir is), or,
See:
* you have too many files in /tmp (even if there is lots of free space)
* [[Wordpress:Introduction_to_Blogging#Pingbacks|Introduction to Blogging, Pingbacks]]


Relevant discussion threads:
===What is trackback?===
* http://wordpress.org/support/3/1738
See:
* http://wordpress.org/support/3/2923
* [[Wordpress:Introduction_to_Blogging#Trackbacks|Introduction to Blogging, Trackbacks]]
* http://wordpress.org/support/3/2760


==Why are the Quote Marks escaped or not escaped?==
===Where is the permalink to my post?===
See:
* [[Wordpress:Linking Posts Pages and Categories|Linking Posts, Pages, and Categories]]


If you write plugins, or use a plugin like [http://www.nosq.com/2004/10/runphp-wordpress-plugin/ RunPHP], or make advanced custom templates, you may eventually find yourself dealing with data in the database.  WordPress <em>usually</em> manages this data for you in such a way that it is immediately usable.  There are circumstances though (especially if you are dealing directly with the database without using WordPress) where you will experience weirdness.
===Can I use desktop blogging software?===
See
*[[Wordpress:Weblog Client]]


For example, quote marks cannot be stored directly in the MySQL database. MySQL uses quote marks in its SQL language. When a quote mark is used, for example, in a post, When the post is saved to the database, every quote mark gets escaped. That means a backslash character is prepended, which signifies that the next character should be taken as part of the input, and not as part of the SQL command. 
===Can I blog by email?===
See
*[[Wordpress:Blog by Email]]


For example, if you are adding the following in your post:
== Spam, Spammers, Comments ==
===What can I do to stop comment spam?===
See:
* [[Wordpress:Combating Comment Spam]]


<pre>...an article about "Happiness" is at
===More Information on Comment Spam===
<a href="http://example.com/happy" title="Happiness">Happiness</a>
See:
if you would like to read it...</pre>
* [[Wordpress:Comment Spam]]


Is actually imported into the database looking like this:
===What Spam words do I need?===
See:
* [[Wordpress:Spam Words]]


<pre>...an article about \"Happiness\" is at
===Why are all the comments being moderated?===
<a href=\"http://example.com/happy\" title=\"Happiness\">Happiness</a>
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.
if you would like to read it...</pre>


When pulling data out of the database, the backslashes may not always be automatically removed. If this becomes an issue, you can use the [http://www.php.net/stripslashes stripslashes()] PHP function on the text.
Right click in the Spam Words box, Select All then Copy and paste it into Notepad to check it.


==Why do I get a blank page when I submit a comment?==
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.
'''Description:''' When anyone tries to comment on a post, the window goes blank and the comment doesn't appear to have been recognised by WordPress.


'''Reason and Solution:'''
Check it carefully :)
The Theme that you are using is missing a critical part of the comment form so WordPress doesn't know which post the comment refers to.  You need to check the comment.php in your Theme and ensure that the following code appears within the form.
<pre>
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</pre>


Relevant discussion threads:
== Importing and Exporting ==
===How do I Import a WordPress WXR file when it says it is too large to import?===
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. 
*Break the WordPress WXR file into smaller pieces by separating the data between a post and pasting the header into each file.
*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.
*Increase the PHP memory limit via .htaccess (e.g. <tt>php_value memory_limit 64M</tt>).  Note: many hosts don't allow this.
*Increase the PHP memory limit via wp-config.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. -->


* http://wordpress.org/support/topic/38683
See:
* [[Wordpress:Importing Content]]
* [[Wordpress:Editing_wp-config.php#Increasing_memory_allocated_to_PHP|Editing wp-config.php]]


[[FAQ|Back to FAQ]]
[[Wordpress:FAQ|Back to FAQ]]

2008年3月24日 (一) 09:19的版本

Back to FAQ

Administration

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:

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?

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:

if ( !isset( $_REQUEST['redirect_to'] ) || is_user_logged_in() )

Immediately after that line, find this line:

<$redirect_to = 'wp-admin/';

and change that to:

$redirect_to = 'index.php';

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 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:

$redirect_to = '../index.php';

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

See:

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.

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.

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 Page it may because there is no template file with the proper structure. For the Page Template box to be available to assign to a 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:

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

That example is from the WordPress Default themes wp-content/themes/default/links.php file.

See also:

Page Templates

Configuration

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

See:

How can I control comments people make?

See:

What do the Discussion Options mean?

See:

How do I install plugins?

See:

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

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 Wordpress: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 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: 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. 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.

See:

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
    • 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?]].
    • If you need help with changing permissions, visit Wordpress:Changing_File_Permissions.
  • 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');


Modifying

Can I change the Smilies?

See:

How do I edit files?

See:

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:

Posts

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

To permit images to be uploaded to your site:

  • Then check main menu across the top. Click Upload

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

See:

What is pingback?

See:

What is trackback?

See:

Where is the permalink to my post?

See:

Can I use desktop blogging software?

See

Can I blog by email?

See

Spam, Spammers, Comments

What can I do to stop comment spam?

See:

More Information on Comment Spam

See:

What Spam words do I need?

See:

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 :)

Importing and Exporting

How do I Import a WordPress WXR file when it says it is too large to import?

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.

  • Break the WordPress WXR file into smaller pieces by separating the data between a post and pasting the header into each file.
  • Increase the PHP memory limit in php.ini by changing the memory_limit setting (e.g. memory_limit = 64M ;) Note: many hosts don't allow this.
  • Increase the PHP memory limit via .htaccess (e.g. php_value memory_limit 64M). Note: many hosts don't allow this.
  • Increase the PHP memory limit via wp-config.php (e.g. define('WP_MEMORY_LIMIT', '64MB');)

See:

Back to FAQ