How to consume and display external data in WordPress from another website

// make request... (optionally save in transient for faster future fetches)
$dom = new DOMDocument();
$dom->loadHTML(wp_remote_retrieve_body($request));
$sections=$dom->getElementsByTagName("section");
foreach ($sections as $section) {
    // Do something...
    }

Leave a Comment