• Resolved michaeloestergaard


    I’m trying to find the JS initialization code for the wpulike button is (aka. checking if a user has liked a post or not)? See the message below for more information about my issue.

    I hope someone can help.

    The reason why I need the code, is explained below:


    On ajax refresh, FacetWP works by destroying and re-creating any DOM elements within the listing container element.

    The side effect is that this also destroys any JS event listeners, which could explain why wpUlike isn’t working after refresh. The solution involves figuring out upUlike’s JS initialization code, and adding it into a facetwp-loaded JS event (so that it re-runs after each ajax refresh).

    He’s a similar example… but to figure out the actual code needed, you may need to reach out to the wpUlike team: https://gist.facetwp.com/gist/re-trigger-ele-custom-skin-js-post-item-links-on-facetwp-loaded/

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Alimir


    Hey @michaeloestergaard
    Please try following sample code and let me know if you had any issues:

    add_action( 'wp_footer', function() { ?>
          (function($) {
            document.addEventListener('facetwp-loaded', function() {
    }, 100 );
    Thread Starter michaeloestergaard


    Thank you very much. It couldn’t make it work though.

    Can it be because I’m using wpUlikePro, and the heart template?

    Looking forward to hear from you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.