年度图片奖

21世纪的社会主义国家

『Would Understanding Award』 摄影师:Tomas Van Houtryve 获奖作品组:“21世纪的社会主义国家。”

乌干达最后的伊甸园

『科学与自然 Science/Natural』 摄影师:Joel Sartore 获奖作品:“乌干达最后的伊甸园”。

更多:http://www.leica.org.cn/poyi_2012/

发表在 忙里偷闲 | 留下评论

wordpress隐藏部分标签

WordPress的,通常是用tags和labels分别在侧栏显示标签云(cloud tags)和在文章中显示文章标记(Labels).由于分工不同,所以并不需要隐藏两个列表中的个别重复标签,但是如果当其中一个列表中的标签提供不一样的作用,就应该相对于另一个列表中的重复标签独立出来。

要不显示标签云中的部分标签并不是很困难因为 wp_tag_clud() 在codex都给出了相关的参数。例如,不显示ID为3和4的标签:

<?php wp_tag_cloud(‘smallest=10&amp;largest=18&amp;exclude=3,4′); ?>

通常来说,在文章中显示标签的功能,默认是没有添加任何参数来隐藏部分标签的:

<?php the_tags(”, ’, ‘, ”); ?>

但是, 我发现更改get_the_tags()可以实现这个功能。首先将以下代码放置在你当前使用主题文件的fuctions.php文件下:

/* Excluir tags en Posts */
function pk_the_tags( $before = ”, $sep = ’, ‘, $after = ”, $exclude = ” ) {
$tags = get_the_tags();
if ( empty( $tags ) )
return false;
$tag_list = $before;
foreach ( $tags as $tag ) {
if (!empty($exclude))
$pos = stripos( $exclude, $tag->name);
else
$pos = false;
if ($pos=== false)
$tag_links[] = ’<a href=”‘ . get_tag_link($tag->term_id) . ’”>’ . $tag->name . ’</a>’;
}
if (empty($tag_links))
return false;
$tag_links = join( $sep, $tag_links );
$tag_links = apply_filters( ’the_tags’, $tag_links );
$tag_list .= $tag_links;
$tag_list .= $after;
echo $tag_list;
}

如上面代码所显示的,每个Label列表的之前和之后都可以使用参数来分隔或隐藏你不想显示的标签。接着,你可以在主题文件的任何一部分调用这个函数,并通过名称来隐藏你不想显示标签。例如,隐藏标签称为“WordPress的”和“Blogger”的:

<?php if (get_the_tags()) pk_the_tags(”, ’, ‘, ”, ’Wordpress, Blogger’); ?>

 

转自:http://hi.baidu.com/wordpress321/blog/item/bda91a62f6636729ab184cbe.html

发表在 忙里偷闲 | 标签为 | 留下评论

冬日去看黄河水

山城水雾

山城水雾

雪水冲浪

雪水冲浪

雪后黄河

雪后黄河

寒林暗灯

寒林暗灯

 

发表在 忙里偷闲 | 留下评论

Next Supercontinent ‘Amasia’ Will Take North Pole Position: Scientific American

In 50 million to 200 million years’ time, all of Earth’s current continents will be pushed together into a single landmass around the North Pole. That is the conclusion of an effort,detailedin the February 9 issue ofNature,to model the slow movements of the continents over the next tens of millions of years. (Scientific Americanis part of Nature Publishing Group.)A supercontinent last formed 300 million years ago, when all the land masses grouped together on the equator as Pangaea, centered aboutwhere West Africa is now. After looking at the geology of mountain ranges around the world, geologists had assumed that the next supercontinent would form either in the same place as Pangaea, closing the Atlantic Ocean like an accordion,or on the other side of the world, in the middle of the current Pacific Ocean.
http://www.scientificamerican.com/article.cfm?id=next-supercontinent-amasia-wil

发表在 忙里偷闲 | 留下评论

跨学科研究的有益尝试

http://blog.sciencenet.cn/home.php?mod=space&uid=1557&do=blog&id=536255

发表在 忙里偷闲 | 留下评论

Google Earth ocean terrain receives major update

http://feedproxy.google.com/~r/geologytimes/~3/Np4-gufRsxw/Google_Earth_ocean_terrain_receives_major_update.asp

发表在 忙里偷闲 | 留下评论

凝望

发表在 忙里偷闲 | 留下评论

春雪

春雪

出行注意安全

发表在 忙里偷闲 | 留下评论

高价, 开放, 免费?

Elsevier遭到抵制,你也可以加入到抵制的行列。以知识信息材料作为挣钱的资源,应是科学发展的障碍。我有时候会想,那么多十分勤奋的民科为什么不能作出些像样的工作呢?一个很重要的原因是,他们很难得到获取基础或最新研究资料,及在专业刊物上发表见解的机会。有些人直接给一篇SCI文章明码标价了,他们认为没有这些资金的支持,很难做出好的工作。

Google发布了,和TED一样,自由分享智慧和见解,共同解决人类所面临的问题。

 

发表在 雅俗共赏 | 标签为 , | 留下评论

wordpress permalink

通常设置permalink(固定链接), 需在后台“/options-permalink.php”中设置即可,但是在“常规设置”里一旦设置了前缀(front),如“/archives/%post_id%”,作者归档页就变成了“/archives/author_base/%author%”,显然我们并不希望出现这样的URL,而是“/author_base/%author%”。

这时需要修改“/wp-include/rewrite.php”

有人提议在该文件末尾(php脚本结束前)添加以下代码:

function change_author_permalinks() {
global $wp_rewrite;
$wp_rewrite->author_base = ‘member’;
$wp_rewrite->author_structure = ‘/’ . $wp_rewrite->author_base. ‘/%author%’;
}
add_action(‘init’,'change_author_permalinks’);

其实只需修改文件中的代码即可,即找到以下代码:

function get_author_permastruct() {
if ( isset($this->author_structure) )
return $this->author_structure;

if ( empty($this->permalink_structure) ) {
$this->author_structure = ”;
return false;
}

$this->author_structure = $this->front . $this->author_base . ‘/%author%’;

return $this->author_structure;
}

将$this->front替换为 ’/’
变成

function get_author_permastruct() {
if ( isset($this->author_structure) )
return $this->author_structure;

if ( empty($this->permalink_structure) ) {
$this->author_structure = ”;
return false;
}

$this->author_structure = ‘/’ . $this->author_base . ‘/%author%’;

return $this->author_structure;
}

然后到后台“固定链接”更新一下即可

发表在 忙里偷闲 | 标签为 , , | 留下评论