• Resolved jamesbuck

    (@jamesbuck)


    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

    thanks,
    James

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Spacetime

    (@spacetime)

    Thread Starter jamesbuck

    (@jamesbuck)

    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

    Plugin Author Spacetime

    (@spacetime)

    You only need to check Remote debugging.

    Thread Starter jamesbuck

    (@jamesbuck)

    Ok, remote debugging is enabled.

    Plugin Author Spacetime

    (@spacetime)

    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

    (@jamesbuck)

    I assume that’s this one? (see screenshot) 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

    (@jamesbuck)

    Hi, any insights from that code block configuration? Thanks.

    Plugin Author Spacetime

    (@spacetime)

    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

    (@jamesbuck)

    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

    (@spacetime)

    Thread Starter jamesbuck

    (@jamesbuck)

    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

    (@spacetime)

    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.

    If you can’t solve the issue you can open a ticket and refer to this thread.

    Thread Starter jamesbuck

    (@jamesbuck)

    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

    (@jamesbuck)

    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

    (@spacetime)

    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)
  • The topic ‘Extra empty code blocks being inserted’ is closed to new replies.