现在的位置: 首页 > 互联网络 > WP相关 > 互联网络 > 正文

wordpress滑动标签代码

2010-04-30 08:13 WP相关, 互联网络 ⁄ 共 1339字 ⁄ 字号 暂无评论

滑动标签代码:

<!-- 自制相关日志 开始 -->
<div id="title">
<ul>
<li><a href="javascript:;" onmouseover="show(0)">热评日志</a></li>
<li><a href="javascript:;" onmouseover="show(1)">随即日志</a></li>
<li><a href="javascript:;" onmouseover="show(2)">最新评论</a></li>
<li><a href="javascript:;" onmouseover="show(3)">最新文章</a></li>
<li><a href="javascript:;" onmouseover="show(4)">文章存档</a></li>
</ul>
</div>
<div id="content">
<div style="display:block"><?php if(function_exists('get_mostcommented')) { get_mostcommented($limit = 10); } ?><!-- 如果使用了 WP中文箱 插件,这里会输出10篇评论最多的日志标题 --></div>

<div><?php $rand_post = get_posts('numberposts=10&orderby=rand');
foreach( $rand_post as $post ) : ?>
<li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?></div>

<div><?php if(function_exists('get_recent_comments_only')) { get_recent_comments_only($no_comments = 10); } ?><!-- 如果使用了 WP中文箱 插件,这里会输出不含 pingback/trackback 的最新评论 --></div>

<div><?php get_recent_posts($no_comments = 10); ?><!-- 此处是 WP中文箱中最新日志调用函数,修改后面的数字可以控制输出条数 --></div>

<div><?php wp_get_archives() ?></div>
</div>
<script type="text/javascript">
function show(n){
var o = document.getElementById('title').getElementsByTagName("a");
var c = document.getElementById('content').getElementsByTagName("div");
for(i = 0; l = o.length, i < l; o[i].className = '',c[i].style.display = 'none',i++ );
o[n].className = 'over';
c[n].style.display = 'block';
}
</script>
<!-- 自制相关日志 结束 -->

给我留言

留言无头像?