ESI conflict with Enfold theme
-
Hi,
We have a problem using ESI on our websites with the Enfold theme + Avia builder. The content of some of our pages are shown twice when ESI is enabled AND an ESI block is rendered to this page (the admin bar for example). The ‘<html>’ and ‘<body>’ tags for example are also rendered twice.
We are debugging this issue for a while now and concluded that the issue only happens when a page has the Avia Template builder enabled AND an ESI block is loaded on this page. A default WordPress page, without using the Avia builder, works as it should.
I dived into the code of both the Enfold theme and the Litespeed plugin.
The Enfold theme has somewhere in the process of building up the Avia builder the next line of code:
add_filter( 'template_include' , array($this, 'template_include'), 20000);
This conflicts somehow with (in /inc/esi.class.php):
add_action( 'template_include', 'LiteSpeed_Cache_ESI::esi_template', 100 ) ;
But.. I can solve the issue by setting the action priority in esi.class.php for
add_action( 'template_include'...
to 20001. Setting the priority to 19999 doubles the content of the page again.Is this something you can fix in the plugin by, for example, set the priority of this action to a very high value since some themes using the ‘template_include’ action with a very high priority as well.
- The topic ‘ESI conflict with Enfold theme’ is closed to new replies.