How to insert ad field on top of Header?

Good day.

I’m working with Cornerstone for the first time and so far it’s simply awesome.

I have the information architecture from a client, and he needs a ad field/banner on top of header.

It would be something like this:

I don’t have the exact measure, but that’s not important right now, it can be rearranged later.

How can I insert that there?

You should know I test it with this answer here and wont work, my website wont even notice about that change.

I’m using X Pro Child theme.

Thanks in advance.

Warm regards.

Actually I ended up “fixing” this. It was AdBlocker blocking that area :tired_face:

Thanks.

Glad to hear you sorted it out and thank you for sharing the solution with us.

Cheers!

Good day.

I have a problem with this. I managed to do it as you previously saw. However when I design a new header and make it global in Header Assignment, it overrides everything and that superior ad space disappears entirely.

How can I fix this?

Thanks in advance.

Warm regards.

Hi @sumavoces,

If your header ET_header is not possible to just assign to specific pages and really needs to be the Global header, then you need to create the other header with the Ads. You can duplicate the ET_header and just add another bar on top of it, then assign that to the pages/posts that needs to have the ads.

How to assign header and footer.

Cheers!

Thanks for your answer @friech!

ET_header it’s actually a global header. What bugs me is how I create an ad space/banner above that header.

Following another post in Support Forum, I did it inserting this code inside my theme’s functions.php file:

// Add Ad above the navbar
// =============================================================================
function ad_leatherboard(){ ?>
  
  <div class="custom-ad x-container max width center-text pam">
    <!-- Ad Leatherboard -->
    <img src="http://placehold.it/768x90" alt="Ad Image">
  </div>

<?php }
add_action('x_before_view_global__navbar', 'ad_leatherboard');
// =============================================================================

Now that code seems to be overridden by ET_header. And I have no idea how to insert it above my header, or as part of the header, which is globally configured at the moment. I know how to insert elements above and below, I just don’t know which one will serve me in order to create an ad banner. I don’t know, maybe there’s a way to do this via HTML code and there’s an element for that purposes, like the classical custom HTML Wordpress widget?

Thanks in advance.

Warm regards.

Hi @sumavoces,

Sorry but Im a bit confused now, is this what you’re trying to do?

That code you show above will only work with the Standard header, Not with a header that is built-in Header Builder (e.g. your ET_header)

If that is the header (ET_header) that you’re trying to put an Ads, then you already have the right idea to add a bar for the ad space. Use the Image element if it is an image banner ad, or Text element if it’s a custom HTML ads, for text element make sure you set the width to 100%.

See the Copy of ET_header as your reference.

Hope it helps,
Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.