如何处理<a href=""> inside a button in wordpress

时间:2016-04-25 11:15:51

标签: wordpress

I am using wordpress for this project. How can I handle the <a> tag which is getting displayed inside a button?
Here is how I am using it

 <button class="red-btn btn-effect reply" type="button">
        <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
    </button>

and its output is shown as

<button class="red-btn btn-effect reply">
        <a rel="nofollow" class="comment-reply-link" href="http://localhost/dynamoLogic/security-vulnerabilities-in-php/?replytocom=3#respond" onclick="return addComment.moveForm( &quot;comment-3&quot;, &quot;3&quot;, &quot;respond&quot;, &quot;18&quot; )" aria-label="Reply to umair">Reply</a>        </button>

Html5 does not support <a> tags inside a button. How to handle this?

1 个答案:

答案 0 :(得分:0)

这是因为按钮不是链接。

删除按钮,输出实际应该是这样的:

<a rel="nofollow" class="red-btn btn-effect reply comment-reply-link" href="http://localhost
/dynamoLogic/security-vulnerabilities-in-php/?replytocom=3#respond" 
onclick="return addComment.moveForm( &quot;comment-3&quot;, &quot;3&quot;,
&quot;respond&quot;, &quot;18&quot; )" aria-label="Reply to 
umair">Reply</a>

添加链接的必要类,您可能需要调整a元素的CSS。