Header ad using html & javascript


I wonder please if you could let me know how to use an advertiser’s supplied html&javascript to add an add to the header ad zone?

They don’t seem to want me to copy a banner and separately set the link.

Thank you,


Hello Oliver,

As Greatmag currently only supplies an image link ads, to add custom code ads, you have to replace this code block with your own:

<?php if ( $header_ad_image ) : ?>
  <div class="header-ad">
    <a target="_blank" href="<?php echo esc_url($header_ad_url); ?>"><img src="<?php echo esc_url($header_ad_image); ?>"/></a>
<?php endif; ?>

These lines of code are located within greatmag_site_branding() function in the inc/functions/functions-header.php file. To do custom changes on this, you can override this function in your child theme’s functions. Please refer ‘Override Parent Theme Functions’ for detailed guide on doing this properly.

aThemes Support