最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

How to use the WordPress API to get links and scripts in <head> and <body>

matteradmin6PV0评论

I'm using the WordPress API as a headless CMS. I have Elementor plugin installed to do page building in the WordPress admin.

I'm trying to figure out how to get all of the <link> and <script> tags that Elementor requires via the WordPress API. The API right now for /pages only gives me the rendered HTML from the_content().

Is there a way to extend WordPress API /pages to either:

  • Return the <head> links and scripts and any <body> links and scripts?
  • Return the full HTML for a page, from <html> to </html>?

My backup solution is to use a screen scraping tool to get the full HTML, but I'd rather avoid doing that.

Post a comment

comment list (0)

  1. No comments so far