
<?php if( have_rows('main_content_block') ):
while ( have_rows('main_content_block') ) : the_row();
if( get_row_layout() == 'full_block' ):
?>
<div class="row primary-block">
<div class="col-md-12">
<h1><?php the_sub_field('main_title'); ?></h1>
<?php the_sub_field('main_content'); ?>
</div>
</div>
<?php endif; endwhile; ?>
<?php endif; ?>
Both sub fields are being displayed in different set of DIVs (“row primary-block” and “col-md-12”), According to login whole block of code should be displayed at once.
<div class="row primary-block">
<div class="col-md-12">
<h1>Duis Mollis est Non Commodo Kuctus Nisierat</h1>
<div class="row primary-block">
<div class="container">
<p>Maecenas sed diam eget risus varius blandit sit amet non magna. Sed posuere consectetur est at lobortis. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
</div>
</div>
You can notice two extra DIVs starting after H1 in above code. This is the output i am getting.
Check the content in the sub field ‘main_content’
The extra div elements being output is happening here
<?php the_sub_field('main_content'); ?>
so those div elements must be in the wysiwyg editor. This can happen when copying content from a web page and pasting it directly into a WP WYSIWYG editor.