• Resolved manas12

    (@manas12)


    Hi,

    So I want to add a wrapper for an ads code block, which means I have to edit the code block HTML. Where can I edit the HTML?

    Thanks in advance.

    Best regards,
    Muhammad Anas

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

    (@spacetime)

    Not sure if I understanf your question.

    You can simply add a wrapper to your code.

    Thread Starter manas12

    (@manas12)

    I am sorry I didn’t make it so clear.
    So I want to make a wrapper to an ads block in HTML. The block has a code like this:

    <div="code-block code-block-8">
    ...
    </div>

    And I want to add another div tag above it so it would be like this:

    <div="myAds">
    <div="code-block code-block-8">
    ...
    </div>
    </div>

    Could I do that? And how?
    Thanks

    Plugin Author Spacetime

    (@spacetime)

    If it is only like listed above then set alignment to No wrapping and set the code you would like to use.

    However, the Ad Inserter wrapping div contains also classes and attributes for cleint-side functions.

    But why would you like an additional wrapping div?

    Thread Starter manas12

    (@manas12)

    I want to optimize and reduce my site’s Cumulative Layout Shift. The CLS is caused by one adsense unit, that on viewport is. The ads unit is responsive.

    When the site is still loading the ads only takes around 50px spaces, but when the site is fully loaded the ads will take up to 250px spaces and pushes the other content below.

    So I have to define the ads fixed height to remove the CLS issue. Perhaps you can help me with this issue?

    • This reply was modified 3 years, 11 months ago by manas12.
    Plugin Author Spacetime

    (@spacetime)

    You can define ad height using custom CSS and reserve ad space, for example, add this code to the CSS:
    https://adinserter.pro/documentation/alignments-and-styles#custom-css

    height: 300px;

    You can also use block Height setting:
    https://adinserter.pro/documentation/additional-block-settings#display

    This way the layout will not shift when the block is inserted.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How To Edit Code Block HTML?’ is closed to new replies.