【问题标题】:Getting inline CSS generated by Elementor with the Wordpress Rest API使用 Wordpress Rest API 获取 Elementor 生成的内联 CSS
【发布时间】:2018-10-29 18:51:28
【问题描述】:

我正在使用 Wordpress REST API 来检索 wordpress 页面的呈现内容。 我的页面是用 Elementor 构建的。 Elementor 在结局页面上添加了一些内联 CSS 以使所有工作正常进行。此内联 CSS 不存在于 API 返回的内容。

调用示例:

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 吗?

【问题讨论】:

    标签: css wordpress custom-wordpress-pages wordpress-rest-api elementor


    【解决方案1】:

    这里描述的解决方案效果很好: https://wordpress.stackexchange.com/questions/292849/displaying-a-page-built-with-elementor-using-the-rest-api/292895

    收到 HTML 后,您可以解析页面并获取 <style> 标记以及 Elementor 生成的所有内联 CSS。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-16
      • 2015-04-04
      • 2018-04-05
      • 2012-02-20
      • 2016-06-17
      • 2021-04-06
      • 2017-10-12
      • 2020-09-20
      相关资源
      最近更新 更多