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

<channel>
	<title>Wopus中文平台 &#187; 技术分享</title>
	<atom:link href="http://www.wopus.org/category/wordpress-deepin/tech/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wopus.org</link>
	<description>我们致力于为WordPress本地化提供动力！</description>
	<pubDate>Fri, 29 Aug 2008 09:28:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>巧妙美化静态化文章分页链接结构</title>
		<link>http://www.wopus.org/rewrite-static-htm-paging.html</link>
		<comments>http://www.wopus.org/rewrite-static-htm-paging.html#comments</comments>
		<pubDate>Wed, 27 Aug 2008 00:38:19 +0000</pubDate>
		<dc:creator>辐射鱼</dc:creator>
		
		<category><![CDATA[技术分享]]></category>

		<category><![CDATA[wordpress]]></category>

		<category><![CDATA[文章分页]]></category>

		<category><![CDATA[静态化]]></category>

		<guid isPermaLink="false">http://www.wopus.org/?p=323</guid>
		<description><![CDATA[前天和大家分享的“如何实现Wordpress文章分页”反响很好，但现在很多WPer都静态化了自己的的Blog，Wopus中文平台也一样，采用了“%postname%.html”这样的链接形式，分页后就变成了“postname.html/2”的形式，相当不美观，我们需要“postname-2.html”这样的形式，来，动两个小手术：

修改wp-includes/rewrite.php 文件
找到
$rewrite = array_merge($rewrite, array($match =&#62; $query))
 在这行代码之前添加以下代码：
if (strpos($match, '.html') !== false &#38;&#38; strpos($query, '&#38;page=') !== false) {
&#160; $match = str_replace('(/[0-9]+)?/?$', '$', $match);
&#160; $rewrite = array_merge($rewrite, array(str_replace('([^/]+).html', '([^/]+)-([0-9]+).html', $match) =&#62; $query));
}
wp-includes/post-template.php 文件
找到wp_link_pages函数，用以下代码替代之：

&#60; ?php
/*
&#160;修改页面链接
*/
function alter_page_link($link, $pagenum){
&#160; return str_replace(&#34;.html&#34;, &#34;-$pagenum.html&#34;, $link);	
}
&#160;
/*
&#160;包含在 / *=================* / 之间的代码作过修改
*/
function wp_link_pages($args = '') {
&#160; $defaults = array(
&#160;&#160; &#160;'before' =&#62; '&#60;p&#62;' . __('Pages:'), [...]]]></description>
			<content:encoded><![CDATA[<p>前天和大家分享的“<a href="http://www.wopus.org/how-to-relize-article-paging.html" target="_blank">如何实现Wordpress文章分页</a>”反响很好，但现在很多WPer都静态化了自己的的Blog，<a href="http://www.wopus.org/" target="_blank">Wopus中文平台</a>也一样，采用了“%postname%.html”这样的链接形式，分页后就变成了“postname.html/2”的形式，相当不美观，我们需要“postname-2.html”这样的形式，来，动两个小手术：</p>
<ol>
<li><strong>修改wp-includes/rewrite.php 文件</strong></li>
<p>找到
<div class="hl-surround"><div class="hl-main">$rewrite = array_merge($rewrite, array($match =&gt; $query))</div></div>
<p> 在这行代码之前添加以下代码：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">if (strpos($match, '.html') !== false &amp;&amp; strpos($query, '&amp;page=') !== false) {</li>
<li>&nbsp; $match = str_replace('(/[0-9]+)?/?$', '$', $match);</li>
<li>&nbsp; $rewrite = array_merge($rewrite, array(str_replace('([^/]+).html', '([^/]+)-([0-9]+).html', $match) =&gt; $query));</li>
<li>}</li></ol></div>
<li><strong>wp-includes/post-template.php 文件</strong></li>
<p>找到wp_link_pages函数，用以下代码替代之：<br />
<span id="more-323"></span></p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">&lt; ?php</li>
<li>/*</li>
<li>&nbsp;修改页面链接</li>
<li>*/</li>
<li>function alter_page_link($link, $pagenum){</li>
<li>&nbsp; return str_replace(&quot;.html&quot;, &quot;-$pagenum.html&quot;, $link);	</li>
<li>}</li>
<li>&nbsp;</li>
<li>/*</li>
<li>&nbsp;包含在 / *=================* / 之间的代码作过修改</li>
<li>*/</li>
<li>function wp_link_pages($args = '') {</li>
<li>&nbsp; $defaults = array(</li>
<li>&nbsp;&nbsp; &nbsp;'before' =&gt; '&lt;p&gt;' . __('Pages:'), 'after' =&gt; '&lt;/p&gt;',</li>
<li>&nbsp;&nbsp; &nbsp;'next_or_number' =&gt; 'number', 'nextpagelink' =&gt; __('Next page'),</li>
<li>&nbsp;&nbsp; &nbsp;'previouspagelink' =&gt; __('Previous page'), 'pagelink' =&gt; '%',</li>
<li>&nbsp;&nbsp; &nbsp;'more_file' =&gt; '', 'echo' =&gt; 1</li>
<li>&nbsp; );</li>
<li>&nbsp;</li>
<li>&nbsp; $r = wp_parse_args( $args, $defaults );</li>
<li>&nbsp; extract( $r, EXTR_SKIP );</li>
<li>&nbsp;</li>
<li>&nbsp; global $post, $id, $page, $numpages, $multipage, $more, $pagenow;</li>
<li>&nbsp; if ( $more_file != '' )</li>
<li>&nbsp;&nbsp; &nbsp;$file = $more_file;</li>
<li>&nbsp; else</li>
<li>&nbsp;&nbsp; &nbsp;$file = $pagenow;</li>
<li>&nbsp;</li>
<li>&nbsp; $output = '';</li>
<li>&nbsp;</li>
<li>&nbsp; /*=================*/</li>
<li>&nbsp; /* 优化一下，太多重复调用了-_-! */</li>
<li>&nbsp; $permalink_structure = get_option('permalink_structure');</li>
<li>&nbsp; $not_public_post = in_array($post-&gt;post_status, array('draft', 'pending'));</li>
<li>&nbsp; $permalink = get_permalink();</li>
<li>&nbsp;</li>
<li>&nbsp; /* 判断永久链接格式是否支持静态化 */</li>
<li>&nbsp; $using_static_permalink = strpos($permalink, '.html') !== false ? true : false;</li>
<li>&nbsp; /*=================*/</li>
<li>&nbsp;</li>
<li>&nbsp; if ( $multipage ) {</li>
<li>&nbsp;&nbsp; &nbsp;if ( 'number' == $next_or_number ) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;$output .= $before;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;for ( $i = 1; $i &lt; ($numpages+1); $i = $i + 1 ) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$j = str_replace('%',&quot;$i&quot;,$pagelink);</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$output .= ' ';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if ( ($i != $page) || ((!$more) &amp;&amp; ($page==1)) ) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( 1 == $i ) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;a href=&quot;' . $permalink . '&quot;&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*=================*/</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( '' == $permalink_structure || $not_public_post ) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;a href=&quot;' . $permalink . '&amp;amp;page=' . $i . '&quot;&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (!$using_static_permalink) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;/a&gt;&lt;a href=&quot;' . trailingslashit($permalink) . user_trailingslashit($i, 'single_paged') . '&quot;&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;/a&gt;&lt;a href=&quot;' . alter_page_link($permalink, $i) . '&quot;&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*=================*/</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$output .= $j;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if ( ($i != $page) || ((!$more) &amp;&amp; ($page==1)) )</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;/a&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;$output .= $after;</li>
<li>&nbsp;&nbsp; &nbsp;} else {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;if ( $more ) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$output .= $before;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$i = $page - 1;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if ( $i &amp;&amp; $more ) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( 1 == $i ) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;a href=&quot;' . $permalink . '&quot;&gt;' . $previouspagelink . '&lt;/a&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*=================*/</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( '' == $permalink_structure || $not_public_post ) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;a href=&quot;' . $permalink . '&amp;amp;page=' . $i . '&quot;&gt;' . $previouspagelink . '&lt;/a&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (!$using_static_permalink) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;a href=&quot;' . trailingslashit($permalink) . user_trailingslashit($i, 'single_paged') . '&quot;&gt;' . $previouspagelink . '&lt;/a&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;a href=&quot;' . alter_page_link($permalink, $i) . '&quot;&gt;' . $previouspagelink . '&lt;/a&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*=================*/</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$i = $page + 1;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if ( $i &lt; = $numpages &amp;&amp; $more ) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( 1 == $i ) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;a href=&quot;' . $permalink . '&quot;&gt;' . $nextpagelink . '';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*=================*/</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( '' == $permalink_structure || $not_public_post ) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;a href=&quot;' . $permalink . '&amp;amp;page=' . $i . '&quot;&gt;' . $nextpagelink . '&lt;/a&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (!$using_static_permalink) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;a href=&quot;' . trailingslashit($permalink) . user_trailingslashit($i, 'single_paged') . '&quot;&gt;' . $nextpagelink . '&lt;/a&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$output .= '&lt;a href=&quot;' . alter_page_link($permalink, $i) . '&quot;&gt;' . $nextpagelink . '&lt;/a&gt;';</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*=================*/</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$output .= $after;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp;}</li>
<li>&nbsp; }</li>
<li>&nbsp;</li>
<li>&nbsp; if ( $echo )</li>
<li>&nbsp;&nbsp; &nbsp;echo $output;</li>
<li>&nbsp;</li>
<li>&nbsp; return $output;</li>
<li>}</li>
<li>?&gt;</li></ol></div>
</ol>
<p>以上步骤在Wordpress2.6下测试通过，代码来自<a href="http://www.voidman.com/2008/03/create-static-html-files-for-paged-post.html" target="_blank">Voidman</a><br />
<strong>注意：</strong><br />
1、当你修改完成后，可能需要到后台设置里重新修改一次“永久链接形式”，无需改动设置，只需点一下“更新”。否则会出现404错误。<br />
2、若没有静态化、伪静态化过Wordpress，也就是没有采用&#8221;%postname%.html&#8221;这样的链接形式，请不要这样修改，否则会出现“404”错误。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wopus.org/rewrite-static-htm-paging.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>如何实现Wordpress文章分页</title>
		<link>http://www.wopus.org/how-to-relize-article-paging.html</link>
		<comments>http://www.wopus.org/how-to-relize-article-paging.html#comments</comments>
		<pubDate>Sun, 24 Aug 2008 19:03:40 +0000</pubDate>
		<dc:creator>辐射鱼</dc:creator>
		
		<category><![CDATA[技术分享]]></category>

		<category><![CDATA[wordpress]]></category>

		<category><![CDATA[文章分页]]></category>

		<guid isPermaLink="false">http://www.wopus.org/?p=300</guid>
		<description><![CDATA[昨天有网友说他的文章太长了，问Wordpress如何实现文章分页，编辑器里没有这个选项，其实Wordpress已经有这个功能了的，只是把该标签隐藏起来了！实现起来很简单，只需两步：

添加wp_link_pages()函数
在你所使用主题的single.php中，找到函数：
&#60; ?php the_content(); ?&#62;
在其后面加上一下代码即可：

&#60; ?php wp_link_pages(array('before' =&#62; '&#60;p&#62;&#60;strong&#62;Pages:&#60;/strong&#62; ', 'after' =&#62; '&#60;/p&#62;', 'next_or_number' =&#62; 'number')); ?&#62;
在文章里手动添加nextpage标签
和more标签类似，使用nextpage标签需切换到HTML源代码模式编辑文章，在需要分页的地方插入
nextpage
记住，分别在nextpage前后加上“”！

这样，你的文章就会实现形如“Pages: 1 2”的分页功能了！但是，使用此方法后，静态化和伪静态化的Blog链接样式不太美观，会出现类似“postname.html/2”的样式，如何将其改成更美观的“postname-2.html”样式，我将在下一篇文章“巧妙美化静态化文章分页链接结构”中和大家分享！
]]></description>
			<content:encoded><![CDATA[<p>昨天有网友说他的文章太长了，问Wordpress如何实现文章分页，编辑器里没有这个选项，其实Wordpress已经有这个功能了的，只是把该标签隐藏起来了！实现起来很简单，只需两步：</p>
<ol>
<li>添加wp_link_pages()函数</li>
<p>在你所使用主题的single.php中，找到函数：</p>
<div class="hl-surround"><div class="hl-main">&lt; ?php the_content(); ?&gt;</div></div>
<p>在其后面加上一下代码即可：<br />
<span id="more-300"></span></p>
<div class="hl-surround"><div class="hl-main">&lt; ?php wp_link_pages(array('before' =&gt; '&lt;p&gt;&lt;strong&gt;Pages:&lt;/strong&gt; ', 'after' =&gt; '&lt;/p&gt;', 'next_or_number' =&gt; 'number')); ?&gt;</div></div>
<li>在文章里手动添加nextpage标签</li>
<p>和more标签类似，使用nextpage标签需切换到HTML源代码模式编辑文章，在需要分页的地方插入</p>
<div class="hl-surround"><div class="hl-main">nextpage</div></div>
<p>记住，分别在nextpage前后加上“<!--”、“-->”！
</ol>
<p>这样，你的文章就会实现形如“Pages: 1 2”的分页功能了！但是，使用此方法后，静态化和伪静态化的Blog链接样式不太美观，会出现类似“postname.html/2”的样式，如何将其改成更美观的“postname-2.html”样式，我将在下一篇文章“<a href="http://www.wopus.org/rewrite-static-htm-paging.html" target="_blank">巧妙美化静态化文章分页链接结构</a>”中和大家分享！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wopus.org/how-to-relize-article-paging.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>在Wordpress侧栏中使用下拉菜单显示分类</title>
		<link>http://www.wopus.org/wp-dropdown-categories.html</link>
		<comments>http://www.wopus.org/wp-dropdown-categories.html#comments</comments>
		<pubDate>Sun, 24 Aug 2008 03:47:07 +0000</pubDate>
		<dc:creator>辐射鱼</dc:creator>
		
		<category><![CDATA[技术分享]]></category>

		<category><![CDATA[wordpress]]></category>

		<category><![CDATA[函数]]></category>

		<category><![CDATA[教程]]></category>

		<guid isPermaLink="false">http://www.wopus.org/?p=294</guid>
		<description><![CDATA[Wordpress侧边栏的空间是很宝贵的，Wopus中文平台的侧栏想展示的东西很多，就把分类放导航栏了，当然，在侧栏用下拉菜单显示分类也可以节省好多空间，而且效果还很cool。还不会？！跟我来：
其实，Wordpress在设计的时候就为我们考虑这个问题了，我们只需使用函数：
&#60; ?php wp_dropdown_categories(); ?&#62;
该函数缺省用法为：

$defaults = array('show_option_all' =&#62; '', 'show_option_none' =&#62; '', 'orderby' =&#62; 'ID', 
'order' =&#62; 'ASC', 'show_last_update' =&#62; 0, 'show_count' =&#62; 0, 'hide_empty' =&#62; 1, 
'child_of' =&#62; 0, 'exclude' =&#62; '', 'echo' =&#62; 1, 'selected' =&#62; 0, 'hierarchical' =&#62; 0, 
'name' =&#62; 'cat', 'class' =&#62; 'postform', 'depth' =&#62; 0);
给几个使用实例：

Dropdown with Submit Button
&#60;li id=&#34;categories&#34;&#62;
&#160;&#60;h2&#62;&#60; ?php [...]]]></description>
			<content:encoded><![CDATA[<p>Wordpress侧边栏的空间是很宝贵的，<a href="http://www.wopus.org/" target="_blank">Wopus中文平台</a>的侧栏想展示的东西很多，就把分类放导航栏了，当然，在侧栏用下拉菜单显示分类也可以节省好多空间，而且效果还很cool。还不会？！跟我来：<br />
其实，Wordpress在设计的时候就为我们考虑这个问题了，我们只需使用函数：</p>
<div class="hl-surround"><div class="hl-main">&lt; ?php wp_dropdown_categories(); ?&gt;</div></div>
<p>该函数缺省用法为：<br />
<span id="more-294"></span></p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">$defaults = array('show_option_all' =&gt; '', 'show_option_none' =&gt; '', 'orderby' =&gt; 'ID', </li>
<li>'order' =&gt; 'ASC', 'show_last_update' =&gt; 0, 'show_count' =&gt; 0, 'hide_empty' =&gt; 1, </li>
<li>'child_of' =&gt; 0, 'exclude' =&gt; '', 'echo' =&gt; 1, 'selected' =&gt; 0, 'hierarchical' =&gt; 0, </li>
<li>'name' =&gt; 'cat', 'class' =&gt; 'postform', 'depth' =&gt; 0);</li></ol></div>
<p>给几个使用实例：</p>
<ol>
<li><strong>Dropdown with Submit Button</strong></li>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">&lt;li id=&quot;categories&quot;&gt;</li>
<li>&nbsp;&lt;h2&gt;&lt; ?php _e('Categories:'); ?&gt;&lt;/h2&gt;</li>
<li>&nbsp;&nbsp; &lt;form action=&quot;&lt;?php bloginfo('url'); ?&gt;&quot; method=&quot;get&quot;&gt;</li>
<li>&nbsp;&nbsp; &lt; ?php wp_dropdown_categories('show_count=1&amp;hierarchical=1'); ?&gt;</li>
<li>&nbsp;&nbsp; &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;view&quot; /&gt;</li>
<li>&nbsp;&nbsp; &lt;/form&gt;</li>
<li>&lt;/li&gt;</li></ol></div>
<li><strong>Dropdown without a Submit Button using JavaScript</strong>
</li>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">&lt;li id=&quot;categories&quot;&gt;&lt;h2&gt;&lt; ?php _e('Posts by Category'); ?&gt;&lt;/h2&gt;</li>
<li>	&lt; ?php wp_dropdown_categories('show_option_none=Select category'); ?&gt;</li>
<li>&nbsp;</li>
<li>&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--</li>
<li>&nbsp;&nbsp; &nbsp;var dropdown = document.getElementById(&quot;cat&quot;);</li>
<li>&nbsp;&nbsp; &nbsp;function onCatChange() {</li>
<li>		if ( dropdown.options[dropdown.selectedIndex].value &gt; 0 ) {</li>
<li>			location.href = &quot;&lt; ?php echo get_option('home');</li>
<li>?&gt;/?cat=&quot;+dropdown.options[dropdown.selectedIndex].value;</li>
<li>		}</li>
<li>&nbsp;&nbsp; &nbsp;}</li>
<li>&nbsp;&nbsp; &nbsp;dropdown.onchange = onCatChange;</li>
<li>--&gt;&lt;/script&gt;</li>
<li>&lt;/li&gt;</li></ol></div>
<li><strong>Dropdown without a Submit Button using JavaScript (2)</strong></li>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">&lt;li id=&quot;categories&quot;&gt;</li>
<li>	&lt;h2&gt;&lt; ?php _e('Posts by Category'); ?&gt;&lt;/h2&gt;</li>
<li>	&lt;form action=&quot;&lt;?php bloginfo('url'); ?&gt;/&quot; method=&quot;get&quot;&gt;</li>
<li>&lt; ?php</li>
<li>	$select = wp_dropdown_categories('show_option_none=Select category&amp;show_count=1&amp;orderby=name&amp;echo=0');</li>
<li>	$select = preg_replace(&quot;#&lt;select([^&gt;]*)&gt;#&quot;, &quot;&lt;select $1 onchange='return this.form.submit()'&gt;&quot;, $select);</li>
<li>	echo $select;</li>
<li>?&gt;</li>
<li>	&lt;noscript&gt;&lt;input type=&quot;submit&quot; value=&quot;View&quot; /&gt;&lt;/noscript&gt;</li>
<li>	&lt;/select&gt;&lt;/form&gt;</li>
<li>&lt;/li&gt;</li></ol></div>
</ol>
<p>够简单吧？！有需要的朋友可以试试！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wopus.org/wp-dropdown-categories.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>WordPress 2.6.1发布</title>
		<link>http://www.wopus.org/wordpress-261-released.html</link>
		<comments>http://www.wopus.org/wordpress-261-released.html#comments</comments>
		<pubDate>Fri, 15 Aug 2008 12:08:22 +0000</pubDate>
		<dc:creator>酋 长</dc:creator>
		
		<category><![CDATA[技术分享]]></category>

		<category><![CDATA[wordpress]]></category>

		<category><![CDATA[wordpress程序提醒更新]]></category>

		<category><![CDATA[wordrepss 2.6.1]]></category>

		<guid isPermaLink="false">http://www.wopus.org/?p=275</guid>
		<description><![CDATA[经历了Beta1和Beta2两个版本的测试之后，WordPress 2.6.1正式版发布，每次新版本的发布总是会修复很多的问题，看起来有点囧！但却是事实，大概的看了一下官方的介绍，这个版本的升级不涉及安全问题，而且官方介绍里有这么一句话：
If you’re happy with 2.6, however, keep on using it.  You need not upgrade to 2.6.1 if 2.6 is getting the job done.(中文：如果你使用2.6版本很愉快，那么不必升级到2.6.1.)
所以，大家不必每次出新的版本就立刻升级，特别是这种小修小补的升级。
WordPess 2.7版本会在11月份才放出，所以，如果不设计到安全问题，建议大家继续使用2.6版本，毕竟一个稳定的版本是我们使用WordPress做博客更需要的。但每次进后台都会有一个讨厌的提醒：WordPress 2.6.1 is available! Please update now.，不升级就会一直存在，看着有点不舒服，今天就告诉大家如何“干掉”WordPress这个提醒功能。

方法一：
修改css，隐藏这个DIV的盒子，从而达到“干掉”提醒功能的目的。
具体做法：通过工具打开wp-admin/wp-admin.css，搜索：
update-nag
在属性里面添加：
display: none;
相信有朋友在搜索的时候会搜索到两个 update-nag ，而且这两个都是和 plugin-update 在一起的，所以，在隐去程序版本提醒功能的同时，也隐去了插件升级提醒的功能，不推荐使用这个方法。
方法二：
直接删除相关的代码。这个针对性很强，不会牵扯到其他的功能，推荐使用。
具体方法：找到 WordPress程序/wp-admin/includes/update.php 文件中的这句代码：
echo &#34;&#60;div id='update-nag'&#62;$msg&#60;/div&#62;&#34;;
删除，上传覆盖。去后台刷新，提示更新已经不见了。
方法三：
使用插件，禁止WordPress程序提示功能。
Disable WordPress Core Update
目前就这三个方法，强力推荐第二个方法，简单，有效。
WordPress程序新版本提示功能2.3版本才开始的，也是一个比较新的功能，而且如果有朋友读了wp-admin/includes/update.php这个文件，可以看到，这个提醒功能系统才开发到1.1版本。
可能有朋友会问，去掉了提示功能，有重要的提示怎么办，很简单，经常关注Wopus中文平台，关于WordPress的一切，你都不再会错过！
好了，就到这里，还是那句话，对于WordPress的新版本，请大家理性对待！
]]></description>
			<content:encoded><![CDATA[<p>经历了Beta1和Beta2两个版本的测试之后，WordPress 2.6.1正式版发布，每次新版本的发布总是会修复很多的问题，看起来有点囧！但却是事实，大概的看了一下官方的介绍，这个版本的升级不涉及安全问题，而且官方介绍里有这么一句话：<br />
<strong>If you’re happy with 2.6, however, keep on using it.  You need not upgrade to 2.6.1 if 2.6 is getting the job done.(中文：如果你使用2.6版本很愉快，那么不必升级到2.6.1.)</strong></p>
<p>所以，大家不必每次出新的版本就立刻升级，特别是这种小修小补的升级。<br />
<a href="http://www.wopus.org/features-plan-wordpress-27.html" target="_blank">WordPess 2.7</a>版本会在11月份才放出，所以，如果不设计到安全问题，建议大家继续使用2.6版本，毕竟一个稳定的版本是我们使用WordPress做博客更需要的。但每次进后台都会有一个讨厌的提醒：<strong>WordPress 2.6.1 is available! Please update now.</strong>，不升级就会一直存在，看着有点不舒服，今天就告诉大家如何“干掉”WordPress这个提醒功能。<br />
<span id="more-275"></span><br />
<strong>方法一：</strong><br />
修改css，隐藏这个DIV的盒子，从而达到“干掉”提醒功能的目的。<br />
具体做法：通过<a href="http://www.wopus.org/css-edit-soft.html" target="_blank">工具</a>打开wp-admin/wp-admin.css，搜索：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">update-nag</li></ol></div>
<p>在属性里面添加：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">display: none;</li></ol></div>
<p>相信有朋友在搜索的时候会搜索到两个 update-nag ，而且这两个都是和 plugin-update 在一起的，所以，在隐去程序版本提醒功能的同时，也隐去了插件升级提醒的功能，不推荐使用这个方法。</p>
<p><strong>方法二：</strong><br />
直接删除相关的代码。这个针对性很强，不会牵扯到其他的功能，推荐使用。<br />
具体方法：找到 WordPress程序/wp-admin/includes/update.php 文件中的这句代码：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">echo &quot;&lt;div id='update-nag'&gt;$msg&lt;/div&gt;&quot;;</li></ol></div>
<p>删除，上传覆盖。去后台刷新，提示更新已经不见了。</p>
<p><strong>方法三：</strong><br />
使用插件，禁止WordPress程序提示功能。<br />
<a href="http://bbs.wopus.org/thread-672-1-1.html" target="_blank">Disable WordPress Core Update</a></p>
<p>目前就这三个方法，强力推荐第二个方法，简单，有效。<br />
WordPress程序新版本提示功能2.3版本才开始的，也是一个比较新的功能，而且如果有朋友读了wp-admin/includes/update.php这个文件，可以看到，这个提醒功能系统才开发到1.1版本。<br />
可能有朋友会问，去掉了提示功能，有重要的提示怎么办，很简单，经常关注<a href="http://www.wopus.org">Wopus中文平台</a>，关于WordPress的一切，你都不再会错过！</p>
<p>好了，就到这里，还是那句话，对于WordPress的新版本，请大家<strong>理性对待</strong>！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wopus.org/wordpress-261-released.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>如何确保您的WordPress安全</title>
		<link>http://www.wopus.org/make-sure-your-wordpress-is-not-hacked.html</link>
		<comments>http://www.wopus.org/make-sure-your-wordpress-is-not-hacked.html#comments</comments>
		<pubDate>Tue, 12 Aug 2008 19:28:48 +0000</pubDate>
		<dc:creator>酋 长</dc:creator>
		
		<category><![CDATA[技术分享]]></category>

		<category><![CDATA[wordpress]]></category>

		<category><![CDATA[wordpress安全]]></category>

		<guid isPermaLink="false">http://www.wopus.org/?p=267</guid>
		<description><![CDATA[感谢Young翻译这么好的文章。
相信很多朋友都看过了WordPress安全白皮书，今天我们继续关注WordPress的安全问题。希望各位能通过Wopus中文平台这一系列关于WordPress的文章，提供自己的安全意思，为自己和访客创造一个好的交流环境。
如何发现WordPress被黑？
识别垃圾链接的最简单的方法就是在浏览器上打开您的网页并检查源代码，特别是HTML标头（Header)和页脚（Footer)，并检查是否有些不应该出现的链接（通常涉及药物、毒品、信用卡等）。
如果您使用Firefox浏览器，您也可以点击“工具”，然后点击“页面信息”，再然后点击“链接”，窗口就会显示您所浏览的当前页面所有的链接。
最后，您也应该检查所有的主题文件和WordPress的安装，看看有没有任何文件或者代码看起来可疑。
入侵个人博客，无非是植入木马或者嵌入链接刷流量，所以大家要对链接地址特别敏感！

如何防止WordPress被黑？
被黑的大多数博客所用的都是旧版的存在一些安全缺陷(Bug)的WordPress，所以您的第一道防线应该是使用最新版本的WordPress。如果您较迟更新到WordPress2.6，请确保所有插件自动升级，整个过程其实很简单。
接着，您也应该通过只允许特定IP访问的方式来保护您的WP-Admin文件夹。您可以在WP-Admin文件夹里创建一个.htaccess文件（一个简单的文本文件），文件上的代码请参考WordPress 三个必须的安全措施。
然后，您也应该取消整个网站目录的导航功能，这样别人就不会知道您使用的插件或者其他敏感的资料。这种方法很简单，您只需要在根目录里的.htaccess文件添加以下一行代码：
Options -Indexes
最后，如果由于某种原因您不能更新您的WordPress或者没有办法只允许某些IP访问您的WP-Admin文件夹，您还可以删除WP- Admin文件夹里面的theme-editor.php文件。这种方法虽然不是最佳的，但是应该有利于阻止别人把一些垃圾链接添加到您的主题文件上。
另外，要记得经常更换您的密码！
原文链接：Make Sure Your WordPress is Not Hacked
]]></description>
			<content:encoded><![CDATA[<p>感谢<a href="http://www.essentialblog.cn" target="_blank">Young</a>翻译这么好的文章。<br />
相信很多朋友都看过了<a href="http://www.wopus.org/wordpress-security-whitepaper.html">WordPress安全白皮书</a>，今天我们继续关注WordPress的安全问题。希望各位能通过<a href="http://www.wopus.org/tag/wordpress">Wopus中文平台</a>这一系列关于WordPress的文章，提供自己的安全意思，为自己和访客创造一个好的交流环境。</p>
<p><strong>如何发现WordPress被黑？</strong><br />
识别垃圾链接的最简单的方法就是在浏览器上打开您的网页并检查源代码，特别是HTML标头（Header)和页脚（Footer)，并检查是否有些不应该出现的链接（通常涉及药物、毒品、信用卡等）。</p>
<p>如果您使用Firefox浏览器，您也可以点击“工具”，然后点击“页面信息”，再然后点击“链接”，窗口就会显示您所浏览的当前页面所有的链接。</p>
<p>最后，您也应该检查所有的主题文件和WordPress的安装，看看有没有任何文件或者代码看起来可疑。</p>
<p>入侵个人博客，无非是植入木马或者嵌入链接刷流量，所以大家要对链接地址特别敏感！<br />
<span id="more-267"></span><br />
<strong>如何防止WordPress被黑？</strong><br />
被黑的大多数博客所用的都是旧版的存在一些安全缺陷(Bug)的WordPress，所以您的第一道防线应该是使用最新版本的WordPress。如果您较迟更新到WordPress2.6，请确保所有插件自动升级，整个过程其实很简单。</p>
<p>接着，您也应该通过只允许特定IP访问的方式来保护您的WP-Admin文件夹。您可以在WP-Admin文件夹里创建一个.htaccess文件（一个简单的文本文件），文件上的代码请<a href="http://www.essentialblog.cn/3-must-apply-security-tips-for-wordpress/" target="_blank">参考WordPress 三个必须的安全措施</a>。</p>
<p>然后，您也应该取消整个网站目录的导航功能，这样别人就不会知道您使用的插件或者其他敏感的资料。这种方法很简单，您只需要在根目录里的.htaccess文件添加以下一行代码：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">Options -Indexes</li></ol></div>
<p>最后，如果由于某种原因您不能更新您的WordPress或者没有办法只允许某些IP访问您的WP-Admin文件夹，您还可以删除WP- Admin文件夹里面的theme-editor.php文件。这种方法虽然不是最佳的，但是应该有利于阻止别人把一些垃圾链接添加到您的主题文件上。</p>
<p><strong>另外，要记得经常更换您的密码！</strong></p>
<p>原文链接：<a href="http://www.dailyblogtips.com/make-sure-your-wordpress-is-not-hacked/" target="_blank">Make Sure Your WordPress is Not Hacked</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wopus.org/make-sure-your-wordpress-is-not-hacked.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
