使用WP REST API的Elementor模板
我正在使用API创建新的WP页面。我有一个Elementor模板,该模板被保存为“ Elementor Canvas”。我希望能够通过API使用此模板创建一个新的Elementor Canvas页面。
据我所知,我无法直接使用Elementor模板创建页面,因此我正在尝试创建一个Elementor Canvas,并将Elementor Template短码添加为“帖子内容”。
唯一不起作用的是画布。该页面是作为默认的WP页面而不是Elementor Canvas创建的,因此模板无法正确格式化。
{
"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"
}
我不确定我是否正在使用错误的名称或其他内容? 我尝试过:
"template": "elementor_canvas"
例如,
"page_template": "elementor_canvas"
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"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论