I’m working on a website where the pages are built using Elementor (Free) on WordPress. The client has decided that one of the built pages should now be shown in a popup when a user clicks on a button on another page (also built using Elementor).
I’ve created the button, I’ve created the popup and I’m using Ajax to fetch the post_content field contents from a PHP plugin. The problem I’m having is that the post_content field doesn’t contain all of the wrapping elements that Elementor places around elements when the content is shown as a page, resulting in the same content not being styled correctly when shown in the popup. There’s a style sheet and then basic elements only. When the same content is viewed as a page, Elementor somehow builds other wrapping elements that make the styling work.
I know all the Elementor CSS and Javascript is enqueued and Elementor is initialised because the page that triggers the popup is built using Elementor.
I’ve tried using the elementor_template shortcode in the PHP hoping that will format the content correctly, but that’s just returning the shortcode text implying that the shortcode is not active (perhaps it’s Pro only).
is there a way in my PHP plugin that I can fetch the post content and use Ajax to send back to the page the content fully formatted so that the Elementor styling works?