今天 @posterous RT了一篇文章:How Posterous is Changing Blogging。注意,它用的是blogging,而不是blog,意思就是,Posterous改变的是写博客的方式,而不是博客本身。恩,下面我也说说自己为什么喜欢用Posterous来更新博客。
使用posterous发布,来源: Western Bridge over Google Wave
今天 @posterous RT了一篇文章:How Posterous is Changing Blogging。注意,它用的是blogging,而不是blog,意思就是,Posterous改变的是写博客的方式,而不是博客本身。恩,下面我也说说自己为什么喜欢用Posterous来更新博客。
使用posterous发布,来源: Western Bridge over Google Wave
今天Wordpress开发博客上发表了一篇文章:WordPress 2.6,意味着Wordpress 2.6正式发布了~
下面我们来看看Wordpress 2.6给我们带来了什么新的功能:
只要使用下面的一段代码,你就可以在Wordpress 2.6中插入高清晰度的视频了(前不久Google推出了youtube视频的高清晰版本)。
<embed src=”http://v.wordpress.com/mARhRBcT/fmt_dvd” type=”application/x-shockwave-flash” width=”640″ height=”385″ flashvars=”blog_domain=http://wordpress.org/development/2008/07/wordpress-26/&width=640&height=385″> </embed>
With this functionnality, you can show related posts on your post. Is related posts which have at least one common tag.
If you don’t wish to show related posts, but use them inside the loop, use st_get_related_posts() function.
<?php st_related_posts(); ?>
‘number’ => 5,
‘order’ => ‘count-desc’,
‘format’ => ‘list’,
‘include_page’ => ‘true’,
‘exclude_posts’ => ”,
‘exclude_tags’ => ”,
‘post_id’ => ”,
‘except_wrap’ => ‘55′,
‘limit_days’ => ‘0′,
‘title’ => __(‘<h4>Related posts</h4>’, ’simpletags’),
‘nopoststext’ => __(‘No related posts.’, ’simpletags’),
‘dateformat’ => $this->dateformat,
‘xformat’ => __(‘<a href="%post_permalink%" title="%post_title% (%post_date%)">%post_title%</a> (%post_comment%)’, ’simpletags’)
We want to show the first 10 related post without title, without pages and without comments count.
<?php st_related_posts(‘number=10&title=&include_page=false&xformat=<a href="%permalink%" title="%title% (%date%)">%title%</a>’); ?>
With this functionnality you can show a color tags cloud created dynamically.
If you don’t want to show it, but use it, use st_get_tag_cloud() function.
<?php st_tag_cloud(); ?>
’size’ => ‘true’,
’smallest’ => 8,
‘largest’ => 22,
‘unit’ => ‘pt’,
‘color’ => ‘true’,
‘maxcolor’ => ‘#000000′,
‘mincolor’ => ‘#CCCCCC’,
‘number’ => 45,
‘format’ => ‘flat’,
‘cloud_selection’ => ‘count-desc’,
‘cloud_sort’ => ‘random’,
‘exclude’ => ”,
‘include’ => ”,
‘limit_days’ => 0,
‘min_usage’ => 0,
‘notagstext’ => __(‘No tags.’, ’simpletags’),
‘xformat’ => __(‘<a href="%tag_link%" class="tag-link-%tag_id%" title="%tag_count% topics" %tag_rel% style="%tag_size% %tag_color%">%tag_name%</a>’, ’simpletags’),
‘title’ => __(‘<h4>Tag Cloud</h4>’, ’simpletags’),
‘category’ => 0
We wish to display randomly the top 100 tags, the max width will be 45px, the min 12px. The color used for max tags will be red (#FF0000) and for min tags green (#00FF0B). At last, the title will be "Tags Cloud"
<?php st_tag_cloud(‘cloud_selection=count-desc&cloud_sort=random&number=100&title=Mon nuage de tags&largest=45&smallest=12&unit=px&maxcolor=#FF0000&mincolor=#00FF0B’); ?>
This feature extend WordPress builtin function "the_tags()", you can specify tag format, text if no tags and post id, also outside the loop
If you don’t want to show it, but use it, use st_get_the_tags() function.
<?php st_the_tags(); ?>
‘before’ => __(‘Tags: ‘, ’simpletags’),
’separator’ => ‘, ‘,
‘after’ => ‘
‘,
‘post_id’ => ”,
‘xformat’ => __(‘<a href="%tag_link%" title="%tag_name%" %tag_rel%>%tag_name%</a>’, ’simpletags’),
‘notagtext’ => __(‘No tag for this post.’, ’simpletags’),
‘number’ => 0
This feature display a list of related tags into tag view. It allow to restrict tag search with an another tag.
This function output a list only on tag view, else it display nothing.
If you don’t wish to show related tags, but use them inside the loop, use st_get_related_tags() function.
<?php st_related_tags(); ?>
‘number’ => 5,
‘order’ => ‘count-desc’,
’separator’ => ‘ ‘,
‘format’ => ‘list’,
‘method’ => ‘OR’,
‘title’ => __(‘<h4>Related tags</h4>’, ’simpletags’),
‘notagstext’ => __(‘No related tag found.’, ’simpletags’),
‘xformat’ => __(‘<span>%tag_count%</span> <a href="%tag_link_add%">+</a> <a href="%tag_link%">%tag_name%</a>’, ’simpletags’)
This feature display a list of remove related tags into tag view. It allow to remove one tag from URL.
This function output a list only on tag view, else it display nothing.
If you don’t wish to show remove related tags, but use them inside the loop, use st_get_remove_related_tags() function.
<?php st_remove_related_tags(); ?>
’separator’ => ‘ ‘,
‘format’ => ‘list’,
‘notagstext’ => ‘ ‘,
‘xformat’ => __(‘» <a href="%tag_link_remove%" title="Remove %tag_name_attribute% from search">Remove %tag_name%</a>’, ’simpletags’)
用来解决官方 WordPress 没有照顾到的中文相关问题。使用这个插件,你可以显示随机文章,最新留言,留言最多文章,发表评论最多的网友,以及真正的文章摘要(如果你的模板里使用的是the_excerpt()来调用内容的话)等等,真正截断,没有乱码。
这个插件由 WordPress 随机文章和 WordPress 评论插件合并增强而来。在激活这个插件之前,请务必先停用这两个插件,不然的话会有冲突。
安装:
解压缩,把 mulberrykit.php 上传至 /wp-content/plugins/
在管理界面里激活 中文 WordPress 工具箱插件(如果你在使用 WordPress 随机文章和 WordPress 评论插件,务必先停用这两个插件。)
1、最新回响
<?php get_recent_comments(); ?>
调用方式:get_recent_comments($no_comments = 5, $before = ‘<li> ‘, $after = ‘</li>’, $show_pass_post = false)
$no_comments:显示回响数,缺省为5条;
$before:每条记录前显示的文字,缺省<li>
$after:每条记录后显示的文字,缺省</li>
$show_pass_post:是(true)/否(false)显示保护了的文章,缺省否(false)
补充:
kdolphin 在回应里提出,希望在最新回响里不显示自己的回应。这很容易做到。在get_recentcomments() 这个函数里找到这一句
post_status = ‘publish’
在后面 加上
AND comment_author != ‘桑葚’
就可以了。(把上面的桑葚改成你自己的昵称;引号是半角的)
注意:最好在wp的插件编辑窗口下改,以免乱码的问题。
根据网友的建议加上了两个相关的函数:
仅显示留言,不包括引用 <?php get_recent_comments_only (); ?>
仅显示引用(包括trackback和pingback)<?php get_recent_trackbacks(); ?>
调用方式与<?php get_recent_comments(); ?>相同。
2、最新文章
根据网友们的反馈,我把这个最新文章的函数又放回来了。
<?php get_recent_posts(); ?>
调用方式:get_recent_posts($no_posts = 5, $before = ‘<li>+ ‘, $after = ‘</li>’, $show_pass_post = false, $skip_posts = 0)
$no_posts:显示文章数,缺省为5条;
$before:每条记录前显示的文字,缺省<li>
$after:每条记录后显示的文字,缺省</li>
$show_pass_post:是(true)/否(false)显示保护了的文章,缺省否(false)
$skip_posts:跳过多少篇文章,缺省为0;
3、评论最多的帖子
<?php get_mostcommented(); ?>
调用方式:get_mostcommented($limit = 5)
4、发表评论最多的网友
<?php get_commentmembersstats(); ?>
把代码里面的blogmaster改成你自己的名字,可以滤掉你自己的名字。
调用方式:get_commentmembersstats($threshhold = 5)
5、随机文章
由这个插件修改而来:
a、改了提取excerpt摘要的方式,可适用于中文;
b、摘要可显示于文章链接的title里,或者直接在页面上,可选;
c、在文章链接的title里显示日期。
在模板里调用 <?php random_posts(); ?>
调用方式: random_posts ($limit = 5, $length = 400, $before = ‘<li>’, $after = ‘</li>’, $show_pass_post = false, $show_excerpt_in_title = true)
$limit:显示文章数,缺省5篇;
$length:摘要长度,缺省400;
$before:每条记录前显示的文字,缺省<li>
$after:每条记录后显示的文字,缺省</li>
$show_pass_post:是(true)/否(false)显示保护了的文章,缺省否(false)
$show_excerpt_in_title:是(true),摘要显示于文章链接的title;否(false),直接显示于页面;缺省是(true)
6、显示摘要
某些情况下需要输出摘要,比如搜索结果、档案,还有 rss 输出,这样可以节省流量资源。但是,如果你的文章是中文的话,官方 WordPress 输出的其实并不是摘要,它只是把文章里的 html 代码过滤掉了,但所有文字都还是原样输出了。
激活这个插件后,输出的就是真正截断的摘要了。