Using Elementor Templates with WP Rest API
-
I am using an API to create new WP pages. I have an Elementor template which is saved as a “Elementor Canvas”. I want to be able to create a new Elementor Canvas page with this template through the API.
As far as I understand I can’t directly create a page using a Elementor Template, so I am trying to create a Elementor Canvas and add the Elementor Template Shortcode as the “post content”.
The only thing that isn’t working is the Canvas. The page is being created as a default WP page, not an Elementor Canvas, so the template isn’t formatting correctly.
Is there a way to fix what I’m doing, or a better way to create a new page from an Elementor Template using Rest API?
{ "action": "create_post", "post_author": "<authorID>", "post_content": "<post content>", /* using: [elementor-template id="3542"] */ "post_title": "Leave us a Review", "post_status": "publish", "post_type": "page", "comment_status": "closed", "post_name": "<post-name>", "page_template": "elementor_canvas" }I’m not sure if I’m using the wrong names or something? For example I’ve tried:
"template": "elementor_canvas"As well as
"page_template": "elementor_canvas"
The topic ‘Using Elementor Templates with WP Rest API’ is closed to new replies.