WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] addComment is not defined (7 posts)

  1. TheGremlyn
    Member
    Posted 1 year ago #

    I've got Jetpack's comments setup on my site, and though they are working in general in that people can comment and connect to social media accounts, I'm having a problem with the Reply button. When clicking the Reply button, the expected behaviour is that the reply box will move to underneath the comment on which Reply was clicked. I'm getting a specific error in the Firebug console, stating: jetpack Uncaught ReferenceError: addComment is not defined. I can see addComment in the page source, and I don't see any other JS errors before it that would cause it to not function.

    Example page: http://blog.assaydepot.com/2013/01/stem-cells-for-non-specialist/
    Theme: https://github.com/Gremlyn/wp-twitstrap
    Example of expected behaviour: http://brewpi.com/brewpi-arduino-shield-soldering-guide/

    I do have W3TC installed, but minify is turned off entirely.

    http://wordpress.org/extend/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    The Reply button is added and controlled by your theme, so you should be able to fix the issue by making changes to your theme's comments.php file.

    Twenty Eleven is a good example, so you can have a look at the comment functions in that theme to see how it should be implemented.

  3. TheGremlyn
    Member
    Posted 1 year ago #

    The comments section in my theme is based on and still very similar to TwentyEleven's. A few stylistic changes are really all that exist. The issue seems to be in the Javascript, with whatever is supposed to define addComment. Maybe there is an element missing I'm unaware of, but from what I can see I have all the elements that TwentyEleven does.

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    When looking at your site, I see a Javascript error when loading the page, before to hit the Reply button:
    Uncaught TypeError: undefined is not a function in bootstrap.min.js

    It might be worth trying to fix this issue with your theme first; that might be what's causing the issue with other Javascript elements like comments.

  5. TheGremlyn
    Member
    Posted 1 year ago #

    Hrm, that wasn't showing up in FireBug for me, but does in Chrome. Seems to stem from jQuery being called after Boostrap. That error no longer exists, but my issue, unfortunately, still does.

  6. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    I had another look at your site, and I couldn't find any reference to comment-reply.js in your code.

    Could you check that it's correctly enqueued in your theme, and that Threaded Comments are enabled in your Discussion Settings?

  7. TheGremlyn
    Member
    Posted 1 year ago #

    Ah-hah! I had wrongly assumed that it would be added for me simply by enabling threaded replies on the site, but no apparently there needs to be a little snippet to include comment-reply.js before calling wp_head(). Seems to be working now, thanks for your patience!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic