• Resolved martymankins

    (@martymankins-1)


    When someone replies to a comment on a post, the comment box is located at the bottom of the page at the end of all previous comments, not right under the comment that is being replied to.

    How do I move the comment box to under the original comment when replying?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter martymankins

    (@martymankins-1)

    If I need to post code, let me know.

    https://www.banalleakage.com

    Hi @marymankins
    Do you want to try adding this to your child theme functions.php?

    add_action('wp_footer','move_respond_box', 150);
    function move_respond_box(){
        if ( ! have_comments() )
            return;
    ?>
    <script type='text/javascript'>
            jQuery(document).ready(function () {
                !function ($) {
                    //prevents js conflicts
                    "use strict";
    
                    var $comment_respond=$('#respond'),
                        $comment_parent = $('#respond .form-submit  #comment_parent').val();
    
                    if ( $comment_parent == 0)
                        return;
    
                    $comment_respond.detach();
                    $comment_respond.insertAfter($('#comments #li-comment-' + $comment_parent + ' > article'));
    
                }(window.jQuery);
            });
       </script>
    <?php
    }
    Thread Starter martymankins

    (@martymankins-1)

    Wow. Worked like a charm. Much thanks for the help and quick response.

    Great.

    Hi,

    I would like to do the same thing only in reverse. Move a response to a comment on the bottom, below the rest of the comments. With the ability to comment on that quote to respond.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘move Reply comment box under original comment’ is closed to new replies.