2. 嵌套回复有针对性的回复性能 (针对某条评论进行回复) 是它的劣势, 同时也是他的优势. 假如有 100 集体在你的一篇文章中宣布了评论, 并且你习气对大局部评论都进行回复, 那是不是你也需求回复差不多 100 次? 假如这样的话, @ 回复比嵌套回复更适宜你.
3. 嵌套回复依赖阅读器对 JavaScript 的支持.
我不应用嵌套回复也是由于前两个缘由, 我不敢确定本人当前会不断应用嵌套回复, 并且在我的回复者中, 常常呈现几集体发问同一个成绩. 应用 @reply 是一个折中的抉择, 我能够在一个回复中答复网友的评论, 并且我无需对相反的发问进行屡次答复; 另外, 经过一些插件, 我同样能够完成回复邮件告诉的性能, 仅是邮件内容稍为复杂罢了.
在主题中完成嵌套回复的办法有二, 包括 WordPress 提供的默许办法和自定义的回调办法. 上面我会解说一下如何完成起嵌套构造, CSS 局部请自行钻研.
默许办法:
WordPress 提供的根本的嵌套格调, default 主题用的就是这种模式.
优点: 不便应用, 缩小代码量.
缺陷: 代码构造不好, 不可能适宜一切的主题.
完成步骤如下:
1. 在 header.php 的 <?php wp_head(); ?> 后方增加以下代码.
<SPAN style="FONT-WEIGHT: bold; COLOR: #000000"><?php</SPAN> <SPAN style="COLOR: #b1b100">if</SPAN><SPAN style="COLOR: #009900">(</SPAN>is_singular<SPAN style="COLOR: #009900">(</SPAN><SPAN style="COLOR: #009900">)</SPAN><SPAN style="COLOR: #009900">)</SPAN> wp_enqueue_script<SPAN style="COLOR: #009900">(</SPAN> <SPAN style="COLOR: #0000ff">'comment-reply'</SPAN> <SPAN style="COLOR: #009900">)</SPAN><SPAN style="COLOR: #339933">;</SPAN> <SPAN style="FONT-WEIGHT: bold; COLOR: #000000">?></SPAN>
<SPAN style="FONT-WEIGHT: bold; COLOR: #000000"><?php</SPAN>
<SPAN style="COLOR: #b1b100">if</SPAN> <SPAN style="COLOR: #009900">(</SPAN><SPAN style="COLOR: #339933">!</SPAN><SPAN style="COLOR: #990000">empty</SPAN><SPAN style="COLOR: #009900">(</SPAN><SPAN style="COLOR: #000088">$_SERVER</SPAN><SPAN style="COLOR: #009900">[</SPAN><SPAN style="COLOR: #0000ff">'SCRIPT_FILENAME'</SPAN><SPAN style="COLOR: #009900">]</SPAN><SPAN style="COLOR: #009900">)</SPAN> <SPAN style="COLOR: #339933">&&</SPAN> <SPAN style="COLOR: #0000ff">'comments.php'</SPAN> <SPAN style="COLOR: #339933">==</SPAN> <SPAN style="COLOR: #990000">basename</SPAN><SPAN style="COLOR: #009900">(</SPAN><SPAN style="COLOR: #000088">$_SERVER</SPAN><SPAN style="COLOR: #009900">[</SPAN><SPAN style="COLOR: #0000ff">'SCRIPT_FILENAME'</SPAN><SPAN style="COLOR: #009900">]</SPAN><SPAN style="COLOR: #009900">)</SPAN><SPAN style="COLOR: #009900">)</SPAN> <SPAN style="COLOR: #009900">{</SPAN>
<SPAN style="COLOR: #990000">die</SPAN> <SPAN style="COLOR: #009900">(</SPAN>__<SPAN style="COLOR: #009900">(</SPAN><SPAN style="COLOR: #0000ff">'Please do not load this page directly. Thanks!'</SPAN><SPAN style="COLOR: #009900">)</SPAN><SPAN style="COLOR: #009900">)</SPAN><SPAN style="COLOR: #339933">;</SPAN>
<SPAN style="COLOR: #009900">}</SPAN>
<SPAN style="FONT-WEIGHT: bold; COLOR: #000000">?></SPAN>
<SPAN style="FONT-WEIGHT: bold; COLOR: #000000"><?php</SPAN> wp_list_comments<SPAN style="COLOR: #009900">(</SPAN><SPAN style="COLOR: #009900">)</SPAN><SPAN style="COLOR: #339933">;</SPAN> <SPAN style="FONT-WEIGHT: bold; COLOR: #000000">?></SPAN>
<SPAN style="FONT-WEIGHT: bold; COLOR: #000000"><?php</SPAN> comment_id_fields<SPAN style="COLOR: #009900">(</SPAN><SPAN style="COLOR: #009900">)</SPAN><SPAN style="COLOR: #339933">;</SPAN> <SPAN style="FONT-WEIGHT: bold; COLOR: #000000">?></SPAN>
<SPAN style="FONT-WEIGHT: bold; COLOR: #000000"><?php</SPAN> cancel_comment_reply_link<SPAN style="COLOR: #009900">(</SPAN><SPAN style="COLOR: #009900">)</SPAN> <SPAN style="FONT-WEIGHT: bold; COLOR: #000000">?></SPAN>
<SPAN style="FONT-WEIGHT: bold; COLOR: #000000"><?php</SPAN> comments_template<SPAN style="COLOR: #009900">(</SPAN><SPAN style="COLOR: #009900">)</SPAN><SPAN style="COLOR: #339933">;</SPAN> <SPAN style="FONT-WEIGHT: bold; COLOR: #000000">?></SPAN>
<?php comments_template(); ?>
<SPAN style="FONT-WEIGHT: bold; COLOR: #000000"><?php</SPAN> comments_template<SPAN style="COLOR: #009900">(</SPAN><SPAN style="COLOR: #0000ff">''</SPAN><SPAN style="COLOR: #339933">,</SPAN> <SPAN style="FONT-WEIGHT: bold; COLOR: #009900">true</SPAN><SPAN style="COLOR: #009900">)</SPAN><SPAN style="COLOR: #339933">;</SPAN> <SPAN style="FONT-WEIGHT: bold; COLOR: #000000">?></SPAN>
<?php comments_template('', true); ?>
<SPAN style="FONT-WEIGHT: bold; COLOR: #000000"><?php</SPAN> wp_list_comments<SPAN style="COLOR: #009900">(</SPAN><SPAN style="COLOR: #009900">)</SPAN><SPAN style="COLOR: #339933">;</SPAN> <SPAN style="FONT-WEIGHT: bold; COLOR: #000000">?></SPAN>
<?php wp_list_comments(); ?>
<SPAN style="FONT-WEIGHT: bold; COLOR: #000000"><?php</SPAN> wp_list_comments<SPAN style="COLOR: #009900">(</SPAN><SPAN style="COLOR: #0000ff">'callback=custom_comments'</SPAN><SPAN style="COLOR: #009900">)</SPAN><SPAN style="COLOR: #339933">;</SPAN> <SPAN style="FONT-WEIGHT: bold; COLOR: #000000">?></SPAN>
<?php wp_list_comments('callback=custom_comments'); ?>
以上就是安达网络工作室关于《WordPress 嵌套回复 (优缺点对照)》的一些看法。更多内容请查看本栏目更多内容!
应用Wordpress这么久不断很厌恶wordpress的文章修订和主动保留性能,也应用过超级开关插件能够制止wordpres...
说到Wordpress可能有的站长还没用过,然而作为一名博客主,假如不晓得它,您真是OUT了!它是小名鼎鼎的PHP博...
明天吃完午饭,劳动劳动,最近搞了一下google adsense,不过最终的审核没经过,我想会不会是界面不难看呢,...
在博客上用到缩略图的机会很多, 它们呈现在文章列表页面, 文章下方的相干文章, 分类页面的类目图片, 甚至有...
1、登录QQ邮箱,点击右下角“浏览空间”,进入浏览空间。 2、进入浏览空间后,点击页面右上角&ld...
之前有网友提出,在WordPress中有没有方法完成每篇文章只容许用户评论一次? 暂不说这个需要有没有用,毕竟...