我正在使用Wordpress REST API来检索wordpress页面的呈现内容。我的页面是用Elementor构建的。Elementor在最终页面上添加了一些内联CSS,以使所有内容都能正常工作。API返回的内容中不存在此内联CSS。
示例调用:
http://website.com/guide/wp-json/wp/v2/pages/23412
响应:
<h1>My title</h1>
真实页面HTML:
<h1>My title</h1> <style>h1 { color: red; }</style>
我正在寻找的部分(没有出现在响应中):
<style>h1 { color: red; }</style>
您知道如何使用Wordpress API检索Elementor生成的内联CSS吗?
发布于 2018-10-29 18:51:28
这里描述的解决方案工作得很好:https://wordpress.stackexchange.com/questions/292849/displaying-a-page-built-with-elementor-using-the-rest-api/292895
一旦接收到超文本标记语言,你就可以解析页面并获得带有所有Elementor生成的内联CSS的<style>标签。
https://stackoverflow.com/questions/52669685
复制相似问题