Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

When using the WordPress comment system the top Comment Reply box dissapears when I click to reply to any of the existing comments. If I then click cancel it reappears.

Is there a way to keep this reply box at the top?

UPDATE

Ok so I have managed to de-register the comment-reply.js and re-register my custom one so now I can look at editing its functionality to copy the comment box rather than move it. Looking at the code I am stumped though, can anyone point me in the right direction of exactly which part I should be looking at?

addComment = {
    moveForm : function(commId, parentId, respondId, postId) {
        var t = this, div, comm = t.I(commId), respond = t.I(respondId), cancel =     t.I('cancel-comment-reply-link'), parent = t.I('comment_parent'), post =     t.I('comment_post_ID');

        if ( ! comm || ! respond || ! cancel || ! parent )
            return;

        t.respondId = respondId;
        postId = postId || false;

        if ( ! t.I('wp-temp-form-div') ) {
            div = document.createElement('div');
            div.id = 'wp-temp-form-div';
            div.style.display = 'none';
            respond.parentNode.insertBefore(div, respond);
        }

        comm.parentNode.insertBefore(respond, comm.nextSibling);
        if ( post && postId )
            post.value = postId;
        parent.value = parentId;
        cancel.style.display = '';

        cancel.onclick = function() {
            var t = addComment, temp = t.I('wp-temp-form-div'), respond =     t.I(t.respondId);

            if ( ! temp || ! respond )
                return;

            t.I('comment_parent').value = '0';
            temp.parentNode.insertBefore(respond, temp);
            temp.parentNode.removeChild(temp);
            this.style.display = 'none';
            this.onclick = null;
            return false;
        }

        try { t.I('comment').focus(); }
        catch(e) {}

        return false;
    },

    I : function(e) {
        return document.getElementById(e);
    }
}
share|improve this question
1  
You have to replace the default JavaScript with one that doesn't move the box but creates a copy instead. Have you tried that? –  toscho Apr 13 '13 at 10:48
    
I hadn't, reading up on it this seems like the way to go. Thanks for the suggestion –  fightstarr20 Apr 13 '13 at 11:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.