'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.
{
"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"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
