<?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>网络蛀虫小窝&#124;电脑技巧　技术　blog &#187; WordPress</title>
	<atom:link href="http://www.onbno.com/archives/tag/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.onbno.com</link>
	<description>网络蛀虫的技术blog,电脑技巧,php,html,word,excel,mysql,js技巧</description>
	<lastBuildDate>Wed, 08 Feb 2012 10:31:39 +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 常用变量获取(通过文章/页面 ID 输出文章/页面 固定链接(永久链接/静态链接）)</title>
		<link>http://www.onbno.com/php-mysql/2650.html</link>
		<comments>http://www.onbno.com/php-mysql/2650.html#comments</comments>
		<pubDate>Tue, 07 Feb 2012 00:58:43 +0000</pubDate>
		<dc:creator>虫子</dc:creator>
				<category><![CDATA[php mysql]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.onbno.com/?p=2650</guid>
		<description><![CDATA[算下来，折腾 wordpress 也有3年多了，做了不多的几个主题，虽然都不觉得怎么样（呵，主要是觉得设计不怎样——自己先汗一个），但其中的各种需求，常见的不常见的，合理的不合理的，通过谷哥，百度，以及 wordpress 官方文章，还是大多解决了的。 下面做一些分享，不是很擅长整理东西，所以，这篇东西只能是慢慢更新了。 &#160; 其中，function 可以插入到主题文件 functions.php 的&#60;?php … ?&#62;代码段中，然后可以在其他主题文件中调用。 &#160; 1、通过文章/页面 slug（扩展名）获取文章/页面 ID &#160; &#60;?php function get_post_id($post_name){ //将该段代码插入主题functions.php global $wpdb; $post_name = $wpdb-&#62;get_var(“SELECT ID FROM $wpdb-&#62;posts WHERE post_name = &#8216;”.$post_name.”&#8216; AND post_status = &#8216;publish&#8217; AND post_type = &#8216;post&#8217;”); return $post_name; } ?&#62; &#160; 其中，如果需要获取的是页面，请将 post_type = ‘post’ 改为 post_type = ‘page’，当然，也许你可以直接删除试试能不能文章/页面通用。 [...]]]></description>
		<wfw:commentRss>http://www.onbno.com/php-mysql/2650.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress循环输出所有子分类及其最近文章</title>
		<link>http://www.onbno.com/wordpress/2646.html</link>
		<comments>http://www.onbno.com/wordpress/2646.html#comments</comments>
		<pubDate>Tue, 07 Feb 2012 00:56:32 +0000</pubDate>
		<dc:creator>虫子</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.onbno.com/?p=2646</guid>
		<description><![CDATA[很久以前就想在自己做的的主题上弄一个这样的页面：将某个分类子分类分别输出，同时输出该子分类的最近文章，可当时，除了一个分类一个分类循环出最新文章之外的方法，确实是不知道，找教程也没找到，后来不了了之，想想确实也没这个需求，呵。 恩最近做cms又遇到这个问题了,在国外网站找到了简单的方法,现在整理处理以备后用,做好的如下图 几天前公司一个项目，终于又出现这个样子的效果图了，诶，只能硬起头皮再想办法。呵，终于功夫不负有心人，代码原型不记得是在哪里找到的了，下面是我修改之后的样子： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 &#60;h1&#62;&#60;?php single_cat_title(); ?&#62;&#60;/h1&#62; &#60;!-- 输出当前分类标题 --&#62; &#60;ul&#62; &#60;?php $i = 0; // 仅为奇偶项 class 作准备 $categories = get_categories('child_of='. [...]]]></description>
		<wfw:commentRss>http://www.onbno.com/wordpress/2646.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>八个有用的WordPress的SQL语句</title>
		<link>http://www.onbno.com/wordpress/2598.html</link>
		<comments>http://www.onbno.com/wordpress/2598.html#comments</comments>
		<pubDate>Sat, 04 Feb 2012 05:44:11 +0000</pubDate>
		<dc:creator>虫子</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.onbno.com/?p=2598</guid>
		<description><![CDATA[在过去的十年中，MySQL已经成为广受欢迎的数据库，而WordPress博客使用的是MySQL数据库，虽然使用插件可以解决一些问题，但是实现某些特殊任务的时候，在phpMyAdmin中执行SQL语句是最简洁的方法，这里就总结八个有用的WordPress系统的SQL语句，用于解决一些实际碰到的问题。 　　1、创建备份数据库 　　备份数据库是首先要做的事情，只需要通过以下方法就可以简单备份数据库： 　　登录phpMyAdmin后。选择你的WordPress数据库，然后点击“导出”按钮，选择一种压缩方式（可以使用gzip）并单击“执行”按钮，当浏览器提示是否下载的时候，点“是”，将数据库文件下载到本地。 　　2、批量删除文章修订 　　WordPress2.6以后的版本增加了一个Post revisions功能，虽然有点用，但文章修订增加了你数据库的大小，我们可以选择批量删除。 　　登录phpMyAdmin后执行下面的SQL语句即可批量删除。 DELETE FROM wp_posts WHERE post_type = “revision”; 　　3、批量删除垃圾评论 　　一个真实的故事是，我的一个朋友在网上建立了一个博客，有次他花了几天时间外出度假，没有上网，当他回来的时候，登录自己的博客，看到有5000多条评论等待审核，当然，大多数都是垃圾评论，要手动删除这些评论要花大量时间，因此我们可以使用以下办法。 　　登录phpMyAdmin后执行下面的SQL语句。 DELETE from wp_comments WHERE comment_approved = &#8217;0&#8242;; 　　要小心，虽然这种解决方案对于处理数百万的垃圾平邮非常有用，但是也会清除未经批准的评论，因此最好还是安装使用Akismet来对付垃圾评论。 　　4、修改文章属性 　　你安装WordPress后，admin账户就创建了，不少人都错误的使用这个帐号来写博客，直到他们认识到，这并不是个人帐号。 　　解决的方法，每篇文章修改作者属性需要大量的时间，下面的这个SQL语句可以帮你快速完成这个功能。 　　首先你要找到你正确的用户名，使用下面的SQL语句可以找到你的用户ID号。 SELECT ID, display_name FROM wp_users; 　　假设这个ID为NEW_AUTHOR_ID，而管理员admin的ID为OLD_AUTHOR_ID，接着，运行下面的SQL语句。 UPDATE wp_posts SET post_author=NEW_AUTHOR_ID WHERE post_author=OLD_AUTHOR_ID; 　　5、手动重设密码 　　很多人为了保护自己的博客不被人黑掉，使用了很复杂的密码，这虽然是一件好事，但也经常会发生遗忘管理员密码的事情。 　　当然，通过电子邮件可以发送给你WordPress重设密码的链接，但如果你无法访问你的邮件地址，那么就只好使用下面的SQL语句来重设你的密码了。 UPDATE wp_users SET user_pass = MD5(&#8216;PASSWORD&#8217;) WHERE wp_users.user_login =&#8217;admin&#8217; LIMIT [...]]]></description>
		<wfw:commentRss>http://www.onbno.com/wordpress/2598.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 主题汉化工具Poedit绿色版下载</title>
		<link>http://www.onbno.com/wordpress/2586.html</link>
		<comments>http://www.onbno.com/wordpress/2586.html#comments</comments>
		<pubDate>Tue, 31 Jan 2012 08:11:45 +0000</pubDate>
		<dc:creator>虫子</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[服务]]></category>
		<category><![CDATA[系统]]></category>

		<guid isPermaLink="false">http://www.onbno.com/?p=2586</guid>
		<description><![CDATA[WordPress有成千上万的主题供大家选择，有很多人喜欢找一下英文主题，但是英文主题的汉化成为一个麻烦事情。现在推荐一个主题汉化的工具，Poedit绿色版。 一般的英文主题都会带有一个lang的语言包，里面有.po和.mo的文件，我们需要汉化的，就是这两个文件。 方法：复制创建一个.po文件副本后，用Poedit打开他，可以看到左侧全部是英文，我们需要做的就是将你觉得不爽的英文全部汉化掉。 选中一行，在下面输入你要显示的中文即可。英文不好的同学可以参考一下Google翻译。 下载地址: http://115.com/file/e6m5b78h#]]></description>
		<wfw:commentRss>http://www.onbno.com/wordpress/2586.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress使用固定链接</title>
		<link>http://www.onbno.com/wordpress/2577.html</link>
		<comments>http://www.onbno.com/wordpress/2577.html#comments</comments>
		<pubDate>Sun, 29 Jan 2012 13:39:34 +0000</pubDate>
		<dc:creator>虫子</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.onbno.com/?p=2577</guid>
		<description><![CDATA[wordpress固定链接是你个人博客里的文章、分类以及其他页面的固定链接地址。通过固定链接，别的博友可以链到你写的博客，你也可以将这个链接地址写在邮件里发给其他人看。如果博客的链接地址变来变去，会造成其他人通过之前的链接地址来浏览博客时出错，所以每篇博客的链接地址都应该固定，而且永久不改———这也是固定链接名字的由来。 默认的链接如下 http://www.onbno.com/?p=N N是文章ID，一串数字。默认链接在所有的环境下都运转良好，但和其他的类型比起来没那么好看。 mod_rewrite: “漂亮的链接” 使用mod_rewrite或lighttpd可以生成更好看的链接地址(查看 漂亮的链接)，有各种个样的链接格式，最常见、最通用的格式如下 http://example.com/category/post-name/ or http://example.com/year/month/day/post-name 有些博主为了使用更简短的链接地址，去掉了部分或全部的日期参数(day, month, year)。 在以下环境中均能配置漂亮链接 Apache web server，需要mod_rewrite模块 Microsoft IIS 7+ web server，需要URL Rewrite模块，版本1.1+，而且PHP5必须使用FastCGI Microsoft IIS 6+ 参考a 404 handler or Mod-Rewrite Pro可能会成功。 Lighttpd 参考a 404 handler or mod_rewrite or mod_magnet (查看外部资源) PATHINFO: “比较好的链接” PATHINFO类型的链接地址和mod_rewrite类型的地址看起来很像，唯一的区别是在前面多了/index.php，如下: http://example.com/index.php/yyyy/mm/dd/post-name/ 除此之外，和mod_rewrite类型的地址一样，也具有同样的可配置性。任何mod_rewrite链接地址可以做的事情，PATHINFO也可以。 有个很有用的插件可以显示使用的是何种类型的链接，以及WordPress重写规则的详细信息。 选择你的固定链接结构 在设置 → 固定链接(WordPress 2.5之前的版本在选项→ 固定链接)，可以选择默认格式，也可以使用结构标签在自定义结构的输入框里输入你想要的格式。 如果想激活PATHINFO类型的链接地址，只要将地址以index.php/开头。 结构标签 结构标签用来自定义mod_rewrite/PATHINFO类型的固定链接地址格式，下面是一些tips： 确保以%post_id%或%postname%结尾(如/%year%/%monthnum%/%day%/%postname%/)，以便每个地址对应唯一的一篇博客。 出于性能上的考量，不推荐以博客类型、博客标签、博客作者、博客标题作为固定链接地址的开头这些都是纯文本的属性(field)，使用它们作为链接的开头，WordPress需要更多的时间区分文章(Post)地址和页面(Page)地址，而且为了区分还要在数据库里存储额外的信息，带来不必要的开销。推荐使用数字的属性(field)作为链接的开头，如年份或文章ID。查看 wp-testers的讨论. %year%  文章发表的年份，四位数，如 2004 %monthnum%  月份，如 05 [...]]]></description>
		<wfw:commentRss>http://www.onbno.com/wordpress/2577.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress自动把文章的主题给图片加入alt</title>
		<link>http://www.onbno.com/wordpress/2568.html</link>
		<comments>http://www.onbno.com/wordpress/2568.html#comments</comments>
		<pubDate>Thu, 19 Jan 2012 12:40:32 +0000</pubDate>
		<dc:creator>虫子</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.onbno.com/?p=2568</guid>
		<description><![CDATA[众所周知，图片是非常容易被搜索引擎收录的，如果你设置了alt标签，那么恭喜你，有可能你的网站权重会因此而增加，但是对于一些童鞋来讲，可能有时候觉得每次都手动加入alt是一件很蛮烦的事情，有时没有什么方法可以让alt自动加入到img标签内，并且自动调用所在文章的主题呢？呵呵，肯定是会有办法的，就像下面那段代码一样，纯粹的微代码，只有几行，但是这个问题就迎刃而解了！ //www.onbno.com add_filter( 'the_content', 'weiphp_image_alt' ); function weiphp_image_alt($c) { global $post; $title = $post-&#62;post_title; $s = array('/src="(.+?.(jpg&#124;bmp&#124;png&#124;jepg&#124;gif))"/i' =&#62; 'src="$1" alt="'.$title.'"'); foreach($s as $p =&#62; $r){ $c = preg_replace($p,$r,$c); } return $c; }]]></description>
		<wfw:commentRss>http://www.onbno.com/wordpress/2568.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>预设文本在WordPress后台编辑器</title>
		<link>http://www.onbno.com/wordpress/2564.html</link>
		<comments>http://www.onbno.com/wordpress/2564.html#comments</comments>
		<pubDate>Thu, 19 Jan 2012 12:29:23 +0000</pubDate>
		<dc:creator>虫子</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[word]]></category>

		<guid isPermaLink="false">http://www.onbno.com/?p=2564</guid>
		<description><![CDATA[搜集 add_filter( &#8216;default_content&#8217;, &#8216;my_editor_content&#8217; ); function my_editor_content( $content ) {$content = “这是一些自定义的内容，增加在后台编辑器里(www.onbno.com).”; return $content;]]></description>
		<wfw:commentRss>http://www.onbno.com/wordpress/2564.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress缩略图的灵活调用</title>
		<link>http://www.onbno.com/wordpress/2559.html</link>
		<comments>http://www.onbno.com/wordpress/2559.html#comments</comments>
		<pubDate>Thu, 19 Jan 2012 12:05:06 +0000</pubDate>
		<dc:creator>虫子</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.onbno.com/?p=2559</guid>
		<description><![CDATA[wordpress的缩略图功能很好用 就是有些函数不知道 今天整理了一些功能记录下来 &#60;?php query_posts(“showposts=7&#38;cat=14&#8243;); //作品展示 if(have_posts()) : while (have_posts()) : the_post(); ?&#62; &#60;td&#62; &#60;a href=”&#60;?php the_permalink() //输出缩略图文章的链接地址?&#62;” rel=”bookmark” title=”&#60;?php printf(__(&#8216;Permanent Link to %s&#8217;, &#8216;kubrick&#8217;), the_title_attribute(&#8216;echo=0&#8242;)); ?&#62;&#38;#13;&#38;#10;&#60;?php the_time(__(&#8216;F jS, Y&#8217;, &#8216;kubrick&#8217;)) ?&#62;”&#62; &#60;img src=” &#60;?php if ( has_post_thumbnail()) { $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), &#8216;large&#8217;); // echo &#8216;&#60;a href=”&#8216; . the_permalink() . &#8216;” title=”&#8216; . the_title_attribute(&#8216;echo=0&#8242;) [...]]]></description>
		<wfw:commentRss>http://www.onbno.com/wordpress/2559.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress缩略图功能</title>
		<link>http://www.onbno.com/wordpress/2556.html</link>
		<comments>http://www.onbno.com/wordpress/2556.html#comments</comments>
		<pubDate>Thu, 19 Jan 2012 08:22:41 +0000</pubDate>
		<dc:creator>虫子</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.onbno.com/?p=2556</guid>
		<description><![CDATA[Post Thumbnail Linking to the Post Permalink Note: Don&#8217;t use these two examples together in the same Theme. &#160; example 1. To link Post Thumbnails to the Post Permalink in a specific loop, use the following within your Theme&#8217;s template files: &#160; &#60;?php if ( has_post_thumbnail()) : ?&#62; &#60;a href=”&#60;?php the_permalink(); ?&#62;” title=”&#60;?php the_title_attribute(); ?&#62;” [...]]]></description>
		<wfw:commentRss>http://www.onbno.com/wordpress/2556.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress插入flv视频插件</title>
		<link>http://www.onbno.com/wordpress/2552.html</link>
		<comments>http://www.onbno.com/wordpress/2552.html#comments</comments>
		<pubDate>Sun, 15 Jan 2012 15:53:50 +0000</pubDate>
		<dc:creator>虫子</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.onbno.com/?p=2552</guid>
		<description><![CDATA[弄了好多的flv插件没有一个兼容性好的 最后找到FLV WordPress Flowplayer非常简单好用 不敢独享 最新版本是1.2.15 版本 作者为 Foliovision &#124; 访问插件主页 使用方法 [flowplayer src='http://www.sundaling.com/wp-content/uploads/2012/01/320x240.flv' width=320 height=240] 有好多的参数在后台可以设置 可以直接插入视频 赞一个]]></description>
		<wfw:commentRss>http://www.onbno.com/wordpress/2552.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.sundaling.com/wp-content/uploads/2012/01/320x240.flv" length="0" type="video/x-flv" />
		</item>
	</channel>
</rss>

