浏览的人很多,但是回复的人很少,小胡刚刚找到了一个这样的插件,类似于论坛上的回复后可见,浏览者发表评论之后才能看到隐藏的内容。
安装方法:直接在WordPress后台插件中搜索Easy2Hide,安装就行啦。
使用方法:
<!--easy2hide start--> 只有对Demon博客中任何文章发表过评论才能阅读隐藏内容 <!--easy2hide end-->
有很多不明真相的群众说该插件没用,只要发表过一次评论就能看见所有隐藏内容。
if you want vistor must reply to current post to read some words, just use : <!–easy2hide start{reply_to_this=true}–>some words <!–easy2hide end–> in editor ; else empty the letters between ‘{‘ and ‘}’.
插件主页上如是说,这个功能也许是后来才加上的吧,也不怪他们不明真相:
<!–-easy2hide start{reply_to_this=true}–>
只有对Demon这篇文章发表过评论才能阅读隐藏内容
<!-–easy2hide end–>
这样就只有回复本文的人才能看到隐藏的内容了。
最后要啰嗦一下的是,从该插件的代码来看,只有评论被获准后才能看到隐藏内容:
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_author_email = '".$email."' and comment_post_id='".$id."'and comment_approved = '1'"); if($comments){ $stats = 'show'; }
如果你的博客开启了评论审核,而该读者是第一次回复的话,在你获准他的回复之前,他仍然无法看到隐藏的内容。在他看来这算是一个BUG,因为他回复了,还是看不见。解决方法很简单,把上面的代码的and comment_approved = ’1′去掉。