Site logo

[Resolved] After Header Hooks: How to Center Ads?

Home Forums Support [Resolved] After Header Hooks: How to Center Ads?

Home Forums Support After Header Hooks: How to Center Ads?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #633402
    Jericho

    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!

    #633425
    Leo
    Staff
    Customer Support

    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/

    #633506
    Jericho

    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!

    #633565
    David
    Staff
    Customer Support

    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.

    #633732
    Jericho

    Thanks, David!

    #633803
    David
    Staff
    Customer Support

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.