• Resolved Stephen Myall

    (@stephen-myall)


    My site
    http://www.reboot2elementary.com

    Having got my site the way I want it I have received some feedback about my blog comments. Firstly the reply button does not work .

    Is there somewhere I can change the style of the comments section. For example I would like to make the content background the same colour as the side bar. I woud also like to add +1 voting etc.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • For some reason, the reply-to links of your website are wrong. Their hrefs should be
    “?replytocom={ID}#respond”, but instead they are “#comment-{ID}”. This can be solved by adding a preg_replace function that would change the hrefs back to what they’re supposed to be but, at least in theory, you should disable whatever is causing the bad reply-to links instead of patching them back with a search/replace function, that will increase the page loading time. Here’s the fix, in case you can’t find the cause:

    add_filter('tc_comment_list', 'fix_replyto_links');
    function fix_replyto_links($output) {
    	return preg_replace(
    		"%(href=')#comment-([0-9]*)'%",
    		"$1?replytocom=$2#respond'",
    		$output,
    		-1);
    	}

    As you might have guessed, this snippet should go in your child theme’s functions.php.

    So, have you installed any plugin that might interfere with WordPress comment links? Have you considered upgrading to the latest version of Customizr? Or to WP 3.8, for that matter?

    Thread Starter Stephen Myall

    (@stephen-myall)

    Two things about your reply. I am not an experienced web designer (just a beginner) and I am still not clear what to to do. Im not sure I can find the cause to fix.

    On my post pages edit screen under “Discussion” I have Cooments and track backs ticked, however under commnents it states ” An unidentified error has occurred.”

    Secondly, I am concerned about updating to customir 3.8 because I made some changes to the customizr theme before I made a child theme.

    Thanks for your reply

    There is a good chance that your mods to Customizr files are causing this, but I’m not excluding plugin interference. If you only want reply-to links to work add my function to functions.php and you’re done. If you find more bugs, bring them here and we’ll see what we can do.

    Note: if your child theme’s functions.php has a ?> on its last line, add my code before it, not after. Also, being a pure php file, you’re much safer if you just delete that end-php-mode altogether. If you choose not to delete ?>, make sure you do not add anything after it (not even an empty space, tab or new empty line) as it will break your website.

    Thread Starter Stephen Myall

    (@stephen-myall)

    There are no plugins I can see that would interfere with “main post” comments. My plugins are generally supporting widgets.

    Any changes I made to the parent theme prior to creating the child theme would be “out of the box” changes (meaning using the customizr menu (no additional code was added).

    I added the code above to my function.php on the childtheme as you describe. Now that being the reply button is not dead as it was before but it doesnt behreplied toave as I would expect. It jumps to the top of the post. I would expect it to create a new comment box below the comment t is being replied to. Any thoughts?

    Well, all I can tell you is the links are proper. You may compare them to the ones on http://demo.themesandco.com/comment-test/
    On that page you can also see what’s the normal behavior when a reply-to link is clicked. However, I have no clue on what’s disabling it of your website and I can only guess it is the same reason that broke the links in the first place.

    Here’s how you can debug this:

    1. Copy the files you modified from Customizr in the child theme, keeping the folder structure.
    2. Activate some default theme (e.g.: 2013)
    3. Delete and than reinstall the same version of Customizr you have installed, from the repository
    4. Activate your child theme and, one by one, rename the modded files (prefixing them with an underscore, for example). As you rename them, they won’t load anymore and the unmodified file, from Customizr, will be loaded instead of it. After you rename a file, check reply-to links to see if that file was causing it.

    If you end up with all files prefixed and reply-links still don’t work, it means the mods you made to Customizr were not causing this.

    You can also try disabling your plugins one by one and see if any of them is causing this.

    Thread Starter Stephen Myall

    (@stephen-myall)

    Ok acub
    Thank you for all your help. I will write back if I have any issues with this. Its clear what i need to do.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Comment reply button’ is closed to new replies.