post_content);
// Load and extract only the latest section
$dom = new DOMDocument();
libxml_use_internal_errors(true);
$dom->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'));
libxml_clear_errors();
$xpath = new DOMXPath($dom);
$latestSection = $xpath->query("//div[contains(@class, 'archive-latest-wrap')]");
if ($latestSection->length > 0) {
echo $dom->saveHTML($latestSection->item(0));
} else {
echo "Latest section not found.";
}
} else {
echo "Error: Podcast page not found.";
}
get_footer();
?>