Hello When I use Esi for shortcodes, instead of displaying the shortcode on the site itself, the shortcode is written.
In fact, the shortcode itself is displayed on the site with a space. like this:
echo do_shortcode(‘[esi my_shortcode]’);
when i check frontend i see:
[my_shortcode ]
there is a space after my_shortcode
Lightspeed and all plugins are updated. I have read all the related articles for it.cache and esi are enabled. The code below also shows the answer of its activation:
Unfortunately, the code you sent did not work for me. I had the same error as my code. When I remove ESI from the beginning of the shortcode, it works correctly, and when I add ESI, it writes the shortcode itself.
your shortcode with esi (A space is at the end of the shortcode, not the beginning. The language of the site was rtl and I wrote it wrong in img):
Thank you for your help. Only Lightspeed plugin is installed on the site. I have coded all parts of the site myself. Yesterday I changed all the codes of the site so that I can use esi. But unfortunately it didn’t work 🙂
Now, on another site on the same server, which I checked, this feature works correctly and it seems that the problem is with my codes, which does not work on shortcodes.
Please answer these questions if possible:
I only need the ESI feature to not cache a div on the page. Is there no other way? Can’t be excluded through class or ID?
Should a code or hook be entered in the theme so that I can implement this feature? I don’t call the wp_head() and wp_footer() codes in my form and I don’t need them. Of course, I don’t think the problem is with these hooks.
Can you send me a sample code with function not shortcode? Something other than those codes inside the Lightspeed site(doc). with the fewest lines of code possible.
Yes. I quickly read the text and did not see the word “otherwise” in the sentence “otherwise you need to use ajax call to update it on client-side”. It had nothing to do with Ajax and jQuery. there is ni log in error_log and I checked everything I could.
I’ll temporarily disable the cache and try again later. If I find a problem, I will announce it on this page.
Viewing 9 replies - 1 through 9 (of 9 total)
The topic ‘esi for shortcodes’ is closed to new replies.