JavaScript for WordPress › Forums › Gutenberg Development › wpautop behavior for dynamic blocks › Reply To: wpautop behavior for dynamic blocks
December 13, 2018 at 1:28 pm
#76392
Participant
Hi,
The same html markup but hard coded is displayed correct. The php generated markup is not . Looking at my php function i think that. myabe, using the ob_start() and ob_get_contents php function could be the problem. This is the code that generated the output.
ob_start();
while ($recent_posts->have_posts()): $recent_posts->the_post();
if($type == 'estate_property'){
get_template_part('templates/property_unit'.$property_card_type_string);
} else {
if(isset($attributes['align']) && $attributes['align']=='horizontal'){
get_template_part('templates/blog_unit');
}else{
get_template_part('templates/blog_unit2');
}
}
endwhile;
$templates = ob_get_contents();
ob_end_clean();