Title: Extra empty code blocks being inserted
Last modified: October 25, 2017

---

# Extra empty code blocks being inserted

 *  Resolved [jamesbuck](https://wordpress.org/support/users/jamesbuck/)
 * (@jamesbuck)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/)
 * Hi, since the latest update, Ad Inserter has been inserting two additional, empty
   code blocks in my Posts, breaking the text flow. It is and was set to insert 
   one ad after 6 paragraphs.
 * Here’s a screenshot of the Ad Inserter settings: [https://imgur.com/a/8GpKq](https://imgur.com/a/8GpKq)
 * thanks,
    James
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fextra-empty-code-blocks-being-inserted%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/page/2/?output_format=md)

 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9621825)
 * Please enable remote debugging:
    [https://wordpress.org/support/topic/ad-inserter-support-how-to-ask-for-help/](https://wordpress.org/support/topic/ad-inserter-support-how-to-ask-for-help/)
 *  Thread Starter [jamesbuck](https://wordpress.org/support/users/jamesbuck/)
 * (@jamesbuck)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9635407)
 * There is no Ad Inserter menu at the top of my posts. “Debugging functions in 
   Admin menu” IS, however, enabled:
 * > [View post on imgur.com](https://imgur.com/a/VsBiX)
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9635609)
 * You only need to check Remote debugging.
 *  Thread Starter [jamesbuck](https://wordpress.org/support/users/jamesbuck/)
 * (@jamesbuck)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9648702)
 * Ok, remote debugging is enabled.
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9650874)
 * On that page code block 3 is inserted but it is empty.
    On other pages this code
   block inserts some quotes.
 * What code is configured for this code block?
 *  Thread Starter [jamesbuck](https://wordpress.org/support/users/jamesbuck/)
 * (@jamesbuck)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9653527)
 * I assume that’s this one? (see screenshot) [https://imgur.com/a/CyQyN](https://imgur.com/a/CyQyN)
 * The configuration hasn’t changed, but for some reason the block is now showing
   up and breaking the text flow since last updates.
 *  Thread Starter [jamesbuck](https://wordpress.org/support/users/jamesbuck/)
 * (@jamesbuck)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9663959)
 * Hi, any insights from that code block configuration? Thanks.
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9663981)
 * Well, you have some PHP code.
 * You need to debug it to see what it outputs.
 * Ad inserter only inserts your code (which is generated by this PHP code).
 *  Thread Starter [jamesbuck](https://wordpress.org/support/users/jamesbuck/)
 * (@jamesbuck)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9671342)
 * I’m not sure what you mean. What are you telling me to do?
 * This code has been there unchanged for over a year and only recently started 
   adding the extra blocks.
 * Let me know specifically what steps to take, thanks.
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9671365)
 * Please enable remote debugging first:
    [https://wordpress.org/support/topic/ad-inserter-support-how-to-ask-for-help/](https://wordpress.org/support/topic/ad-inserter-support-how-to-ask-for-help/)
 *  Thread Starter [jamesbuck](https://wordpress.org/support/users/jamesbuck/)
 * (@jamesbuck)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9682931)
 * Remote debugging is enabled! That’s what you asked me to do first, which is what
   I’m responding to. Why is it inserting three code blocks instead of one, even
   when empty?
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9684102)
 * Block 1 is inserted and visible.
 * Block 2 is also inserted but hidden on desktop (configured for mobile devices).
 * Block 3 is inserted but your PHP code doesn’t generate anything, however, there
   are also spaces. To prevent insertion delete all characters before and after 
   PHP code.
 * If the code block is empty (no characters) it should not be inserted.
 * ![](https://i0.wp.com/i.imgur.com/8Xknaal.png?ssl=1)
 * If you can’t solve the issue you can [open a ticket](http://igorfuna.com/contact/contact-igor-funa)
   and refer to this thread.
 *  Thread Starter [jamesbuck](https://wordpress.org/support/users/jamesbuck/)
 * (@jamesbuck)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9684639)
 * Ok! Thanks for looking at that.
 * As you can see, the Block 1 is breaking the text flow. It appears it’s because
   it’s now inserting a clear:both;
 * <div class=”code-block code-block-3″ style=”margin: 8px 0; clear: both;”>
    </
   div>
 * The clear is NOT in the code I inserted; did you add this in an update? Code:
 *  <?php if(get_field(‘article_pullquote’) != “”) { ?>
    <div class=”pullquote-area”
   > <div class=”article-pullquote”><?php the_field(‘article_pullquote’); ?></div
   > </div> <?php } ?>
 * So, how do I get rid of the inline inserted clear:both; that is breaking text
   flow and is not in my code? Thanks!
 *  Thread Starter [jamesbuck](https://wordpress.org/support/users/jamesbuck/)
 * (@jamesbuck)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9684651)
 * Ok, I figured it out! Edit “Alignment and Style” and remove the clear:both; –
   must be new. Possibly worth adding to instructions. Ok, thanks!
 * As to why the Ad Inserter menu does not appear at the top of my posts (with the
   debugger), should I open a separate thread for that?
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/#post-9684652)
 * OK, now I understand the problem.
 * The solution is simple. Set **Alignment and style** to **No wrapping**.
    Then
   only your code will be inserted (no wrapping div).
 * Of course you can also use custom CSS without `clear: both;`.
    For example: `
   margin: 8px 0;`

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/page/2/?output_format=md)

The topic ‘Extra empty code blocks being inserted’ is closed to new replies.

 * ![](https://ps.w.org/ad-inserter/assets/icon-256x256.jpg?rev=1502039)
 * [Ad Inserter - Ad Manager & AdSense Ads](https://wordpress.org/plugins/ad-inserter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ad-inserter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ad-inserter/)
 * [Active Topics](https://wordpress.org/support/plugin/ad-inserter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ad-inserter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ad-inserter/reviews/)

 * 16 replies
 * 2 participants
 * Last reply from: [Spacetime](https://wordpress.org/support/users/spacetime/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/extra-empty-code-blocks-being-inserted/page/2/#post-9684685)
 * Status: resolved