【问题标题】:Reply link wordpress doesn't work回复链接 wordpress 不起作用
【发布时间】:2014-05-05 23:10:59
【问题描述】:

我正在尝试在我的 cmets.php 表单上添加回复链接,但它不起作用。它只会刷新我的页面!

我使用的代码如下:

<div class= replay_text">
<font size="-1"><strong><a href="<?php comment_reply_link( array ( 'reply_text' => 'Replay alt="Reply">' ) ); ?>">Reply</a></strong></font></div>

有人帮帮我吗?

【问题讨论】:

    标签: php html css wordpress hyperlink


    【解决方案1】:

    我不太了解php,但我认为问题在于您忘记打开",而您在php 上说的是reply_text 而不是replay_text。这是正确的:

    <div class= "reply_text">
    <font size="-1"><strong><a href="<?php comment_reply_link( array ( 'reply_text' => 'Replay alt="Reply">' ) ); ?>">Reply</a></strong></font></div>
    

    【讨论】:

    • 纠正语言错误与worpdress内部功能和修复问题无关:(
    • 对不起,我认为这可能只是语言错误...我不希望他知道它只是语言而坚持搜索错误
    • 他只是以某种方式使用了一个函数,它不应该被使用。还以数组的方式发送参数,我只是不明白他在做什么。
    【解决方案2】:

    http://core.trac.wordpress.org/browser/tags/3.5/wp-includes/comment-template.php#L1371

    检查应该如何使用comment_reply_link。使用它作为锚源并不是最好的主意,而且我见过更糟糕的情况,但你不会接受任何事情。

    而不是在锚目标中使用它,在其他 html 元素之间:

    <?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-05-18
      • 2013-08-14
      • 2015-07-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多