<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>爱在深邱 &#187; WordPress</title>
	<atom:link href="http://www.shenaiqiu.com/archives/category/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.shenaiqiu.com</link>
	<description>深爱邱&#124;每天爱你多一些</description>
	<lastBuildDate>Wed, 25 Jan 2012 19:52:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>给 WordPress 添加数字验证码</title>
		<link>http://www.shenaiqiu.com/archives/wordpress/1317.html</link>
		<comments>http://www.shenaiqiu.com/archives/wordpress/1317.html#comments</comments>
		<pubDate>Tue, 26 Apr 2011 20:00:52 +0000</pubDate>
		<dc:creator>Shenai Qiu</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[数字验证]]></category>
		<category><![CDATA[数字验证码]]></category>

		<guid isPermaLink="false">http://www.shenaiqiu.com/?p=1317</guid>
		<description><![CDATA[　　第一步，打开根目录下的wp-comments-post.php文件，查找 if ( '' == $comment_content ) 这段代码，在此上面增加以下代码： if ( !$user-&#62;ID ) { $aaa = trim($_POST[aaa]); $bbb = trim($_POST[bbb]); $subab = trim($_POST[sub... ]]></description>
			<content:encoded><![CDATA[<p>　　第一步，打开根目录下的wp-comments-post.php文件，查找</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">if ( '' == $comment_content )</pre></div></div>

<p>这段代码，在此上面增加以下代码：</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">if ( !$user-&gt;ID ) {
$aaa = trim($_POST[aaa]);
$bbb = trim($_POST[bbb]);
$subab = trim($_POST[subab]);
if((($aaa+$bbb)!=$subab)|| empty($subab)){wp_die( __('错误提示：请正确输入的两数相加的和。') );
 }
}</pre></div></div>

<p>　　第二步，修改主题的comments.php文件，查找评论表单的位置，在适当的位置添加如下代码：</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;?php if (!$user_ID) : ?&gt; 
&lt;?php $aaa=rand(0,5); $bbb=rand(3,9); ?&gt;
&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;subab&quot; id=&quot;subab&quot; size=&quot;22&quot; tabindex=&quot;4&quot;/&gt;&lt;/small&gt;&lt;input name=&quot;aaa&quot; value=&quot;&lt;?php echo $aaa; ?&gt;&quot; type=&quot;hidden&quot; /&gt;&lt;input name=&quot;bbb&quot; value=&quot;&lt;?php echo $bbb; ?&gt;&quot; type=&quot;hidden&quot; /&gt;&lt;small&gt; =&lt;/small&gt;&lt;?php echo $aaa; ?&gt;+&lt;?php echo $bbb; ?&gt;&lt;label for=&quot;Validation&quot;&gt;&lt;small&gt; (validation)&lt;/small&gt;&lt;/label&gt;&lt;/p&gt;
&lt;?php endif; ?&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.shenaiqiu.com/archives/wordpress/1317.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>关于 WP-DownloadManager 首页调用代码</title>
		<link>http://www.shenaiqiu.com/archives/wordpress/1304.html</link>
		<comments>http://www.shenaiqiu.com/archives/wordpress/1304.html#comments</comments>
		<pubDate>Tue, 26 Apr 2011 18:01:58 +0000</pubDate>
		<dc:creator>Shenai Qiu</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[wp-downloadmanager]]></category>
		<category><![CDATA[下载插件]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://www.shenaiqiu.com/?p=1304</guid>
		<description><![CDATA[　　因为网站的需要，我在Wordpress加载了下载插件wp-downloadmanager，但是这个十分优秀的下载插件居然没有在首页直接调用下载次数的代码，无语了，彻底的无语了！ 　　在网上倒弄了一个星期... ]]></description>
			<content:encoded><![CDATA[<p>　　因为网站的需要，我在Wordpress加载了下载插件wp-downloadmanager，但是这个十分优秀的下载插件居然没有在首页直接调用下载次数的代码，无语了，彻底的无语了！</p>
<p>　　在网上倒弄了一个星期的Google，也没有搜出可用的代码，对于PHP编程，我连菜鸟级都不是，就一PHP文盲，我怎么可能搞掂。只能老老实实的在Wordpress中文论坛求助了。</p>
<p>　　在伟大的sejie10011版主顶力的帮助下，终于！首页调用并显示的代码被硬生生的“搞”出来了。哈哈，实在太开心了。</p>
<p>　　伟大的ejie10011版主真是犀利!</p>
<p>　　言归正传，Hacklog-downloadmanager或wp-downloadmanager在首页调用并显示文件下载次数和链接的方法:</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">/*
author: 荒野无灯
author url: http://www.ihacklog.com
date: 2011-04-24
*/
&nbsp;
/* start Hacklog-downloadmanager或wp-downloadmanager 首页调用函数 by 荒野无灯*/
function the_hacklogdownload_file()
{
global $post;
$id=hacklogdownload_do_get_downid($post-&gt;post_content);
                $conditions = array ();
                if ( '' != $id ) {
                        if (strpos ( $id, ',' ) !== false) {
                                $conditions [] = &quot;file_id IN ($id)&quot;;
                        } else {
                                $conditions [] = &quot;file_id = $id&quot;;
                        }
                }
                if ($conditions) {
                        echo download_embedded ( implode ( ' AND ', $conditions ), 'both' );
                } else {
                        echo '';
                }
}
function hacklogdownload_do_get_downid($content)
{
$val='';
if(preg_match(&quot;@\[download id=\&quot;([0-9,\s]+)\&quot;\]@&quot;,$content,$matches) )
{
        $val=$matches[1];
}
return $val;
}
/* end Hacklog-downloadmanager或wp-downloadmanager 首页调用函数 by 荒野无灯*/</pre></div></div>

<p>　　将以上代码放入当前所用主题functions.php文件之</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;?php</pre></div></div>

<p>标签内。</p>
<p>　　首页调用代码</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;?php the_hacklogdownload_file();?&gt;</pre></div></div>

<p>　　以上代码适用于Hacklog-downloadmanager和wp-downloadmanager各种版本。</p>
<p>　　伟大的sejie10011版主的博客:<a href="http://www.ihacklog.com">http://www.ihacklog.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shenaiqiu.com/archives/wordpress/1304.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>img 元素设置 padding 无效，搞“死”人啊！</title>
		<link>http://www.shenaiqiu.com/archives/wordpress/1298.html</link>
		<comments>http://www.shenaiqiu.com/archives/wordpress/1298.html#comments</comments>
		<pubDate>Sat, 26 Feb 2011 10:07:27 +0000</pubDate>
		<dc:creator>Shenai Qiu</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[DIV+CSS]]></category>

		<guid isPermaLink="false">http://www.shenaiqiu.com/?p=1298</guid>
		<description><![CDATA[　　DIV+CSS 半桶水不到的我，这次真的被 padding 搞“死”了，不管怎么修改在 IE6 就是无效，“死”不“死”。100%把别人代码拷贝过来都不行，我还有什么话可说。 　　无语、郁闷、无奈、不... ]]></description>
			<content:encoded><![CDATA[<p>　　DIV+CSS 半桶水不到的我，这次真的被 padding 搞“死”了，不管怎么修改在 IE6 就是无效，“死”不“死”。100%把别人代码拷贝过来都不行，我还有什么话可说。</p>
<p>　　无语、郁闷、无奈、不爽、想爆脏话（算了，互联网上的小盘友太多还是不要教坏人家了。）。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shenaiqiu.com/archives/wordpress/1298.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>让中文版WordPress的the_time(&#8216;M&#8217;)显示英文月份</title>
		<link>http://www.shenaiqiu.com/archives/wordpress/1292.html</link>
		<comments>http://www.shenaiqiu.com/archives/wordpress/1292.html#comments</comments>
		<pubDate>Thu, 10 Feb 2011 13:26:20 +0000</pubDate>
		<dc:creator>Shenai Qiu</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.shenaiqiu.com/?p=1292</guid>
		<description><![CDATA[　　可以用下面的方法让the_time(&#8216;M&#8217;)显示英文月份。通过PHP的date函数和WordPress自带的get_the_time函数，可以让他显示成英文的Jan 27,2010。 代码如下 &#60;?php $u_time = get_the_time('U'); /*获取日志... ]]></description>
			<content:encoded><![CDATA[<p>　　可以用下面的方法让the_time(&#8216;M&#8217;)显示英文月份。通过PHP的date函数和WordPress自带的get_the_time函数，可以让他显示成英文的Jan 27,2010。</p>
<p>代码如下</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;?php
$u_time = get_the_time('U'); /*获取日志文章发表时间的时间戳*/
echo date(&quot;M j,Y&quot;,$u_time); /*Jan 27,2010*/
echo date(&quot;F j,Y&quot;,$u_time); /*January 27,2010*/
?&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.shenaiqiu.com/archives/wordpress/1292.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 内容更新时自动通知会员</title>
		<link>http://www.shenaiqiu.com/archives/wordpress/1286.html</link>
		<comments>http://www.shenaiqiu.com/archives/wordpress/1286.html#comments</comments>
		<pubDate>Sat, 22 Jan 2011 06:50:59 +0000</pubDate>
		<dc:creator>Shenai Qiu</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.shenaiqiu.com/?p=1286</guid>
		<description><![CDATA[　　如何在博客内容更新时自动通知所有注册会员？方法很简单，您只需要在 functions.php 文件中添加以下代码即可： function email_members($post_ID) { global $wpdb; $usersarray = $wpdb-&#62;get_results(&#34;SELECT us... ]]></description>
			<content:encoded><![CDATA[<p>　　如何在博客内容更新时自动通知所有注册会员？方法很简单，您只需要在 functions.php 文件中添加以下代码即可：</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">function email_members($post_ID)  {
    global $wpdb;
    $usersarray = $wpdb-&gt;get_results(&quot;SELECT user_email FROM $wpdb-&gt;users;&quot;);
    $users = implode(&quot;,&quot;, $usersarray);
    mail($users, &quot;您关注的博客“爱在深邱”已有更新&quot;, '&lt;a href=&quot;http://www.shenaiqiu.com&quot;&gt;点此查看博客更新内容&lt;/a&gt;');
    return $post_ID;
}
add_action('publish_post', 'email_members');</pre></div></div>

<p>　　当可能数据量大时效率会有下降。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shenaiqiu.com/archives/wordpress/1286.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>第一次用手机写博客</title>
		<link>http://www.shenaiqiu.com/archives/journal/1276.html</link>
		<comments>http://www.shenaiqiu.com/archives/journal/1276.html#comments</comments>
		<pubDate>Thu, 20 Jan 2011 14:28:02 +0000</pubDate>
		<dc:creator>Shenai Qiu</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[手机]]></category>

		<guid isPermaLink="false">http://www.shenaiqiu.com/?p=1276</guid>
		<description><![CDATA[　　老婆逛街买衣服，我陪。她选她的衣服，我玩我的手机，一个月30个小时免费Wifi上网时长不用白不用。 　　…… 　　逛累了，不想写了。 　　第一次用手机写博客，哈哈... ]]></description>
			<content:encoded><![CDATA[<p>　　老婆逛街买衣服，我陪。她选她的衣服，我玩我的手机，一个月30个小时免费Wifi上网时长不用白不用。</p>
<p>　　……</p>
<p>　　逛累了，不想写了。</p>
<p>　　第一次用手机写博客，哈哈。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shenaiqiu.com/archives/journal/1276.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 模板代码调用说明（二）</title>
		<link>http://www.shenaiqiu.com/archives/wordpress/1265.html</link>
		<comments>http://www.shenaiqiu.com/archives/wordpress/1265.html#comments</comments>
		<pubDate>Sun, 16 Jan 2011 13:42:07 +0000</pubDate>
		<dc:creator>Shenai Qiu</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.shenaiqiu.com/?p=1265</guid>
		<description><![CDATA[　　再次分享 WordPress 调用代码，代码都是在网上收集的。这些小小的代码不用的时候感觉有一些碍眼，一但需要的时候又找不到。还是留好点。wordpress 已更新到3.04版本，所以部分调用代码可... ]]></description>
			<content:encoded><![CDATA[<p>　　再次分享 WordPress 调用代码，代码都是在网上收集的。这些小小的代码不用的时候感觉有一些碍眼，一但需要的时候又找不到。还是留好点。wordpress 已更新到3.04版本，所以部分调用代码可能有调整。</p>
<p>1.显示最新文章</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;!--p query_posts('showposts=5');--&gt;
&lt;ul&gt;
&lt;!--p while (have_posts()) : the_post();--&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.shenaiqiu.com/wp-admin/&amp;lt;?php the_permalink() ?&amp;gt;&quot;&gt;&lt;!--p the_title();--&gt;&lt;/a&gt;
&nbsp;
&lt;!--p endwhile--&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></div></div>

<p>2.显示最新评论</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;!--p  global $wpdb;  $sql = &quot;SELECT DISTINCT ID, post_title, post_password, comment_ID,  comment_post_ID, comment_author, comment_date_gmt, comment_approved,  comment_type,comment_author_url,  SUBSTRING(comment_content,1,30) AS com_excerpt  FROM $wpdb-&gt;comments
LEFT OUTER JOIN $wpdb-&gt;posts ON ($wpdb-&gt;comments.comment_post_ID =
$wpdb-&gt;posts.ID)
WHERE comment_approved = '1' AND comment_type = '' AND
post_password = ''
ORDER BY comment_date_gmt DESC
LIMIT 10&quot;;
$comments = $wpd--&gt;get_results($sql);
$output = $pre_HTML;
$output .= &quot;\n
&lt;ul&gt;&quot;;
foreach ($comments as $comment) {
$output .= &quot;\n
	&lt;li&gt;&quot;.strip_tags($comment-&amp;gt;comment_author)
.&quot;:&quot; . &quot;&lt;a href=&quot;\&quot;&gt;ID) .
&quot;#comment-&quot; . $comment-&amp;gt;comment_ID . &quot;\&quot; title=\&quot;on &quot; .
$comment-&amp;gt;post_title . &quot;\&quot;&amp;gt;&quot; . strip_tags($comment-&amp;gt;com_excerpt)
.&quot;&lt;/a&gt;
&nbsp;
&quot;;
}
$output .= &quot;\n&lt;/li&gt;
&lt;/ul&gt;
&quot;;
$output .= $post_HTML;
echo $output;?&amp;gt;</pre></div></div>

<p>3.显示热评文章</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;!--p $result = $wpd--&gt;get_results(&quot;SELECT comment_count,ID,post_title FROM $wpdb-&amp;gt;posts ORDER BY comment_count DESC LIMIT 0 , 
&nbsp;
10&quot;);
foreach ($result as $topten) {
$postid = $topten-&amp;gt;ID;
$title = $topten-&amp;gt;post_title;
$commentcount = $topten-&amp;gt;comment_count;
if ($commentcount != 0) { ?&amp;gt;
	&lt;li&gt;&lt;a title=&quot;&amp;lt;?php echo $title ?&amp;gt;&quot; href=&quot;http://www.shenaiqiu.com/wp-admin/&amp;lt;?php echo get_permalink($postid); ?&amp;gt;&quot;&gt;&lt;!--p echo $title--&gt;&lt;/a&gt;
&nbsp;
&lt;!--p } }--&gt;&lt;/li&gt;</pre></div></div>

<p>4.显示文章分类</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;!--p wp_list_cats('sort_column=name');--&gt;</pre></div></div>

<p>5.显示归档</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;!--p wp_get_archives('type=monthly');--&gt;</pre></div></div>

<p>6.在侧栏显示页面列表</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;!--p wp_list_pages('title_li='); ?&gt;</pre></div></div>

<p>7.调用Gravatar(只适应2.5以上)</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;?php if(function_exists(’get_avatar’)){ echo get_avatar($comment, ‘50?);} ?&gt;</pre></div></div>

<p>8.在侧栏显示页面的子页面</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;?php$children = wp_list_pages('title_li=&amp;#038;child_of='.$post-&gt;ID.'&amp;#038;echo=0');
if ($children) {--&gt;
&lt;ul&gt; &lt;!--p echo $children;--&gt;&lt;/ul&gt;
&lt;!--p }--&gt;</pre></div></div>

<p>9.显示Wordpress标签</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;!--p the_tags();--&gt;</pre></div></div>

<p>10.显示Wordpress标签云</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;!--p wp_tag_cloud('smallest=8&amp;#038;largest=36&amp;#038;');--&gt;</pre></div></div>

<p>11.模板标题</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;!--p /* Template Name: Portfolio */--&gt;</pre></div></div>

<p>12.动态标题标签</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;!--pif (is_home()) { echo bloginfo('name');  } elseif (is_404()) {  echo '404 Not Found';  } elseif (is_category()) {  echo 'Category:'; wp_title('');  } elseif (is_search()) {  echo 'Search Results';  } elseif ( is_day() || is_month() || is_year() ) {  echo 'Archives:'; wp_title('');  } else {  echo wp_title('');  } --&gt;</pre></div></div>

<p>13.在独立页面中运行PHP</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt;!--p if ( is_home() ) { include ('file.php'); }--&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.shenaiqiu.com/archives/wordpress/1265.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0.1 升级吗？</title>
		<link>http://www.shenaiqiu.com/archives/wordpress/1230.html</link>
		<comments>http://www.shenaiqiu.com/archives/wordpress/1230.html#comments</comments>
		<pubDate>Sun, 15 Aug 2010 06:10:29 +0000</pubDate>
		<dc:creator>Shenai Qiu</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.shenaiqiu.com/?p=1230</guid>
		<description><![CDATA[　我很大声的说，不升。 　呵呵，不知道现在用的主题是否支持 3.0.1 ，安全起见... ]]></description>
			<content:encoded><![CDATA[<p>　我很大声的说，不升。</p>
<p>　呵呵，不知道现在用的主题是否支持 3.0.1 ，安全起见。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shenaiqiu.com/archives/wordpress/1230.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 模板代码调用说明（一）</title>
		<link>http://www.shenaiqiu.com/archives/wordpress/1209.html</link>
		<comments>http://www.shenaiqiu.com/archives/wordpress/1209.html#comments</comments>
		<pubDate>Wed, 07 Jul 2010 05:29:11 +0000</pubDate>
		<dc:creator>Shenai Qiu</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[模板]]></category>

		<guid isPermaLink="false">http://www.shenaiqiu.com/?p=1209</guid>
		<description><![CDATA[　　网上收集到的 wordpress 调用代码，官方已经放出新的3.0版本，所以部份调用代码可能有调整。 一、Wordpress 模板基本文件说明 　　1.style.css 样式表文件 　　2.index.php 主页文件 　　3.single.php ... ]]></description>
			<content:encoded><![CDATA[<p>　　网上收集到的 wordpress 调用代码，官方已经放出新的3.0版本，所以部份调用代码可能有调整。</p>
<p>一、Wordpress 模板基本文件说明</p>
<p>　　1.style.css 样式表文件<br />
　　2.index.php 主页文件<br />
　　3.single.php 日志单页文件<br />
　　4.page.php 页面文件<br />
　　5.archvie.php 分类和日期存档页文件<br />
　　6.searchform.php 搜索表单文件<br />
　　7.search.php 搜索页面文件<br />
　　8.comments.php 留言区域文件(包括留言列表和留言框)<br />
　　9.404.php 404错误页面<br />
　　10.header.php 网页头部文件<br />
　　11.sidebar.php 网页侧边栏文件<br />
　　12.footer.php 网页底部文件</p>
<p><span id="more-1209"></span>二、Wordpress Header头部 PHP代码<br />
注: PHP代码必须放置在 和 在之间<br />
　　1.网站标题</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p bloginfo('name');--&gt;</pre></div></div>

<p>　　2.日志或页面标题　</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p wp_title();--&gt;</pre></div></div>

<p>　　3.Wordpress主题样式表文件style.css的相对地址</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p bloginfo(’stylesheet_url');--&gt;</pre></div></div>

<p>　　4.Wordpress博客的Pingback地址</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p bloginfo('pingback_url');--&gt;</pre></div></div>

<p>　　5.Wordpress主题文件的相对地址</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p bloginfo('template_url');--&gt;</pre></div></div>

<p>　　6.博客的Wordpress版本</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p bloginfo('version');--&gt;</pre></div></div>

<p>　　7.Wordpress博客的Atom地址</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p bloginfo('atom_url');--&gt;</pre></div></div>

<p>　　8.Wordpress博客的RSS2地址</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p bloginfo('rss2_url');--&gt;</pre></div></div>

<p>　　9.Wordpress博客的绝对地址</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p bloginfo('url');--&gt;</pre></div></div>

<p>　　10.Wordpress博客的名称</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p bloginfo('name');--&gt;</pre></div></div>

<p>　　11.网站的HTML版本</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p bloginfo('html_type');--&gt;</pre></div></div>

<p>　　12.网站的字符编码格式</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p bloginfo('charset');--&gt;</pre></div></div>

<p>三、Wordpress 主体模板 PHP代码<br />
　　1.日志内容</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p the_content();--&gt;</pre></div></div>

<p>　　2.确认是否有日志</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p if(have_posts()) :--&gt;</pre></div></div>

<p>　　3.如果有，则显示全部日志　　</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p while(have_posts()) : the_post();--&gt;</pre></div></div>

<p>　　4.结束PHP函数”while”</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p endwhile;--&gt;</pre></div></div>

<p>　　5.结束PHP函数“if”</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p endif;--&gt;</pre></div></div>

<p>　　6.header.php文件的内容</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p get_header();--&gt;</pre></div></div>

<p>　　7.sidebar.php文件的内容</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p get_sidebar();--&gt;</pre></div></div>

<p>　　8.comments.php文件的内容</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p comments_template();--&gt;</pre></div></div>

<p>　　9.footer.php文件的内容</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p get_footer();--&gt;</pre></div></div>

<p>　　10.显示格式为“02-19-08”的日期</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p the_time('m-d-y')--&gt;</pre></div></div>

<p>　　11.显示一篇日志的留言链接</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p comments_popup_link();--&gt;</pre></div></div>

<p>　　12.显示一篇日志或页面的标题</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p the_title();--&gt;</pre></div></div>

<p>　　13.显示一篇日志或页面的永久链接/URL地址</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p the_permalink()--&gt;</pre></div></div>

<p>　　14.显示一篇日志或页面的所属分类</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p the_category(',')--&gt;</pre></div></div>

<p>　　15.显示一篇日志或页面的作者</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p the_author();--&gt;</pre></div></div>

<p>　　16.显示一篇日志或页面的ID</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p the_ID();--&gt;</pre></div></div>

<p>　　17显示一篇日志或页面的编辑链接</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p edit_post_link();--&gt;</pre></div></div>

<p>　　18.显示Blogroll中的链接</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p get_links_list();--&gt;</pre></div></div>

<p>　　19.显示一份博客的页面列表</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p wp_list_pages();--&gt;</pre></div></div>

<p>　　20.显示一份博客的分类列表</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p wp_list_cats();--&gt;</pre></div></div>

<p>　　21.下一篇日志的URL地址</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p next_post_link('%link')--&gt;</pre></div></div>

<p>　　22.上一篇日志的URL地址</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p previous_post_link('%link')--&gt;</pre></div></div>

<p>　　23.调用日历</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p get_calendar();--&gt;</pre></div></div>

<p>　　24.显示一份博客的日期存档列表</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p wp_get_archives()--&gt;</pre></div></div>

<p>　　25.显示较新日志链接(上一页)和较旧日志链接（下一页）</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p posts_nav_link();--&gt;</pre></div></div>

<p>　　26.显示博客的描述信息</p>

<div class="wp_syntax"><div class="code"><pre class="lan" style="font-family:monospace;">&lt;!--p bloginfo('description');--&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.shenaiqiu.com/archives/wordpress/1209.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Windows 主机上 Wrodpress 固定链接设置方法</title>
		<link>http://www.shenaiqiu.com/archives/journal/1058.html</link>
		<comments>http://www.shenaiqiu.com/archives/journal/1058.html#comments</comments>
		<pubDate>Wed, 31 Mar 2010 05:37:34 +0000</pubDate>
		<dc:creator>Shenai Qiu</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Wrodpress]]></category>
		<category><![CDATA[虚拟主机]]></category>

		<guid isPermaLink="false">http://www.shenaiqiu.com/?p=1058</guid>
		<description><![CDATA[　　一时冲动把博客迁移回国内，在淘宝网购买了一款双线虚拟主机(不限流量) ，300MB空间，59元/年，价格还可以，速度也还行。 　　昨天发现日志无法正常是打开，只有首页可以正常显示。... ]]></description>
			<content:encoded><![CDATA[<p>　　一时冲动把博客迁移回国内，在淘宝网购买了一款双线虚拟主机(不限流量) ，300MB空间，59元/年，价格还可以，速度也还行。</p>
<p>　　昨天发现日志无法正常是打开，只有首页可以正常显示。问题的最魁祸首居然是 Windows 主机不支持 Wrodpress 的固定链接设置，晕哦。还是Linux主机好使，随便设置自己喜欢的自定义链接。</p>
<p>　　问题解决的办法还是有的，前提条件是服务器或虚拟主机提供商的控制面板有自定义404错误页面的选项。</p>
<p>　　新建一个记事本或打开文字编辑器（EditPlus），写入以下代码并另存为404.php，将文件上传至您的虚拟主机，</p>

<div class="wp_syntax"><div class="code"><pre class="lang" style="font-family:monospace;">&lt;?php
$qs = $_SERVER['QUERY_STRING'];
$pos = strrpos($qs, '://');
$pos = strpos($qs, '/', $pos + 4);
$_SERVER['REQUEST_URI'] = substr($qs, $pos);
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
include('index.php');
?&gt;</pre></div></div>

<p>　　设置404自定义错误指向 404.php，绝大多数的服务器控制面板均提供自定义404错误页选项。如果你的 WordPress 不是安装在根目录，请注意 404.php 的路径地址。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shenaiqiu.com/archives/journal/1058.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

