Site logo

Archived topic

After Header Hooks: How to Center Ads?

5 replies · Started by Jericho on July 26, 2018

Viewing posts 1–6 of 6

Hi GP Team,

How can I center the ad I placed in "After Header Hooks" section? It went to the left side of the screen.

Also, I wish to add some Margin on Top/Below the ad. What code do I need to make this possible and where do I need to place them?

Thanks!

Hi there,

I'm seeing full width ads so there shouldn't be any alignment issue.

You can try this in hooks:

<div class="after-header-ad">
    insert ad here
</div>

Then target with CSS:

.after-header-ad {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

Hi Leo,

As you noticed, the ads are very big. Is there a way to adjust the width?

This screenshot can perfectly describe what I want it to look like http://prntscr.com/kbgonk

Thanks very much!

Hi there, you can add the grid-container class to the wrap ie.

<div class="after-header-ad grid-container">

It will then match the container width of your content.

Thanks, David!

You're welcome we're glad to be of help.

This archived topic is closed to new replies.