• Anonymous User 319290

    (@anonymized-319290)


    I’m trying to use your plugin with the twentyfourteen wordpress theme, but modified for completely static HTML (in the same way, for example, that Disqus works on static html pages).

    I have your plugin working on the 2014 theme, but when I save the page as a static html file, and then load that resulting static page (ie, a cached version) existing comments don’t appear until after the user posts a new comment. Reloading again makes all comments disappear.

    I have “Load comments async threshold” set to 0 and “Trigger to load comments async” set to DomReady.

    Any ideas on how I can get this to work on a static (non-generated) page?

    Thanks,

    Andy

    wordpress version 4.0

    https://www.ads-software.com/plugins/wp-ajaxify-comments/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Could you send me a link where I can see your generated HTML pages?

    Thread Starter Anonymous User 319290

    (@anonymized-319290)

    Here’s a test page in a live environment:

    https://www.sierradescents.com/test.html

    I see no comments when it loads; comments appear via ajax when I post a comment. Note that I’m logged in (via cookie) for this page, so you won’t be able to post comments because logging behavior isn’t handled by ajax…

    What do you think?

    Hi,
    the problem is, that the “Load comments async” feature works in a way that the page is rendered without comments (by using a WordPress filter function) and after the page is rendered it asynchronously loads the same URL (without the filter) to get the contents. In your case the plugin loads the test.htm page again and this page contains no comments.

    If you would like to use the “Load comments async” feature in your static page you need to call WPAC.LoadComments(url) function and pass a URL that renders the page including the comments.

    Hope this helps…

    Thread Starter Anonymous User 319290

    (@anonymized-319290)

    is it possible to use javascript to send the post id to that function, or does that have to be done on the server side?

    Hi,
    the JavaScript function just gets the content from that URL and extracts the comments. You can any URL to that method (named url or url that contains the post id in any way) but you have to make sure that this URL returns the post including all comments.
    I do not know the details of your implementation, but you may have to add some custom code to handle the URLs.

    Hope this helps…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Display AJAX Comments on Static HTML Page’ is closed to new replies.