I have an array of posts from an WPQuery by doing
$query = new WPQuery(.....)
$array_of_posts = $query->post_content
However this is returning the content as HTML as with some other stuff too
<!-- wp:paragraph -->
<p>the text</p>
<!-- /wp:paragraph -->
And then i want to display this as content for each post in the array
foreach($array_of_posts as $post){
<h1> echo $post->post_content </h1>
But of course this just gives me a h1 with the html and other stuff. How can i just get the string?
Also this code is just pseudo code i know the syntax is wrong