I’m trying to use pjax on a webpage, and have encountered a problem where plugin widgets are breaking due to not being reloaded. In an attempt to solve this, I’m using a pjax:complete flag to reinitialize the widgets, for example:

(function() {   
    $(document).on('pjax:complete', function() {
        yotpo.initWidgets();
}).call(this);

However, this requires plugin-specific commands for each widget, and many of them don’t seem to actually have a javascript-accessible init function. Is there some way to do a generalized reload of wordpress widgets from this sort of conditional call?

Read more here: Reload WordPress widgets on pjax:complete


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: