I’ve been searching for this for way too long, but this is the way to get the HTML output of a page in WordPress.
$id = 10;
$page = get_post( $id );
$parsed_content = parse_blocks( $page->post_content );
$output = '';
foreach ( $parsed_content as $content ) {
$output .= render_block( $content );
}
echo $output;
Leave a Reply