WordPress评论回复导致手风琴崩溃


Wordpress comment reply causing accordion to collapse

我的Wordpress注释框被包装在手风琴中。选中后,注释将显示在下面。

当您单击其中一个评论下的"回复"时,页面将重新加载,手风琴将再次折叠。它将您带到页面上的空白区域,如果手风琴仍然打开,注释框将位于该空白区域。

有什么方法可以使手风琴保持打开状态或使评论框显示在需要回复的特定帖子下方?

重新加载页面的具体功能是:

onclick='return addComment.moveForm( "div-comment-28", "28", "respond", "1409" )'

我使用的是默认的wordpress注释代码,可在comment.php中找到。这是 html:

<div class="accordion check">
        <label for="panel1" class="ac-label">View Comments</label>
        <input id="panel1" type="checkbox"/>
        <div class="panel">
<ol class="commentlist">
    <?php
        //Gather comments for a specific page/post 
        $comments = get_comments(array(
            'post_id' => get_the_ID(),
            'status' => 'approve'));
        //Display the list of comments
        wp_list_comments(array(
            'per_page' => 10, //Allow comment pagination
            'reverse_top_level' => false //Show the latest comments at the top
        ), $comments);?>
                    <div class="comments"><?php comment_form(); ?></div>
                </ol>
        </div></div>

可能的解决方案。如果回复显示在评论下方,则页面不会重新加载,手风琴也不会折叠。

看这里:如何使回复框显示在评论下方