One of the pages on my site has more than 20 shortcodes from toolset. The page takes a lot of time as all shortcodes need to fetch data before the page loads.
I was wondering if there is a way to delay executing shortcodes until after the page loads. That way, user can start working on the page and the data is fetched parallelly by the shortcode, This will improve the user experience as they won't have to wait for as long as 16 seconds.
In summary, is there a way to lazy load toolset shortcodes so that user does not need to wait for the code the execute?
Image with delay uploaded.
Hi,
Thank you for contacting us and I'd be happy to assist.
There is no built-in feature available in Toolset to delay the loading/execution of shortcodes. I also couldn't find any other plugin online which can help with the lazy loading of content from shortcodes.
To achieve something like this through custom code, you'll have to make use of the WordPress AJAX feature, and here are some useful resources on the topic:
hidden link
https://wordpress.stackexchange.com/questions/249929/load-content-in-a-div-with-ajax
For more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar
My issue is resolved now. Thank you!