提前欢迎访客的到来
五 14, 2010 | wordpress 建站攻略 |
大多数情况下,访客访问博客时只会毫无生气地浏览博文,那么是否能否在访客到来时让博客自身向访客问好呢?接下来教大家如何让博客自身提前欢迎访客的到来。
参造的是访客浏览时产生的 cookie ,通过 cookie 跟踪和记录访客信息,从而实现提前欢迎访客的到来, 具体操作如下:
1,在 head.php 文件中先插入以下代码:
<script type=”text/javascript”
src=”http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js”>
</script>
2,在 footer.php 中插入以下代码:
< ?php if($_COOKIE["comment_author_" . COOKIEHASH]!=""): ?>
<script type="text/javascript">
document.title = "< ?php printf(__('%s, 欢迎回到 '), $_COOKIE["comment_author_" . COOKIEHASH]) ?>" + document.title
</script>
< ?php endif; ?>
?>
完成上述2操作步骤,就算搞定了,简单吧!去试试吧!





五月 15th, 2010 at 5:53 下午
额,俺的博客主题好像不支持
五月 16th, 2010 at 9:38 下午
有些主题确实不支持这类函数。