Site logo

[Resolved] Cannot reply to comments

Home Forums Support [Resolved] Cannot reply to comments

Home Forums Support Cannot reply to comments

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #1955748
    Jesse

    Hi David,

    I figured it out. First, the reply button worked normally when Yoast was the only plugin I disabled. This is why I thought the issue was with Yoast alone.

    I did some additional testing, and as it turns out, the reply button worked normally when Yoast was ENABLED but only if the Code Snippets plugin was DISABLED. This meant one of my snippets was conflicting with Yoast.

    So I started turning off my snippets one at a time, and I narrowed it down to this filter:

    add_filter( 'cancel_comment_reply_link', '__return_false' );

    I can leave all plugins turned on as normal. When I turn off this one single filter, my reply button works normally again. The above filter is discussed here: https://generatepress.com/forums/topic/h3-comment-reply-title/

    It fixed an issue where the H3 within the HTML would appear as “Leave a Comment Cancel reply” instead of just “Leave a Comment” which I wanted to clean up for accessibility purposes.

    So now my reply button works normally again, but my H3 is back to “Leave a Comment Cancel reply” which bugs me. Any ideas?

    Best regards,
    Jesse

    #1955836
    David
    Staff
    Customer Support

    Ah good find… not sure why removing that would break the reply link. I would suggest opening a topic with Yoast support to see if they have any ideas.

    #1973409
    Jesse

    Hi David,

    Yoast provided a video of their test environment where they added this filter:

    add_filter( 'cancel_comment_reply_link', '__return_false' );

    And the comment reply button worked normally. I did some more testing today and as soon as I turn this filter on, it breaks the comment reply button.

    Do you have any other thoughts? Yoast suggested that maybe the “cancel reply” text could be removed within the child theme.

    Best regards,
    Jesse

    #1973457
    David
    Staff
    Customer Support

    The Comment Reply form is only output once in the WP comments-form.php template. When you reply to an existing comment it uses Javascript to move the form and rewrite the reply link etc. So there is no way to remove it without it affecting ALL replies.

    Instead of disabling the cancel reply link you could try simply returning an empty space in its place:

    add_filter( 'cancel_comment_reply_link', function() {
        return ' ';
    } );
    #1973461
    Jesse

    Thanks, David. Great idea, but unfortunately that filter creates the same behavior. The standard reply button stops working when I enable it.

    #1973731
    David
    Staff
    Customer Support

    Running out of options here… but i did find this clever snippet:

    https://seobro.de/wordpress-kommentare-link-bearbeiten-abbrechen/

    It removes the default comment reply cancel link and hooks a replacement link in below the comments form.

    #1973756
    Jesse

    Hi David,

    I like that one, thanks!

    #1973767
    David
    Staff
    Customer Support

    Awesome – glad to be of help!

Viewing 8 posts - 16 through 23 (of 23 total)
  • You must be logged in to reply to this topic.