Site logo

Archived topic

Trouble Adding Mobile Advertising Banner

1 reply · Started by Mike on August 1, 2020

Viewing posts 1–2 of 2

Hello,
I have sold advertising to someone who wants a banner on both desktop and mobile. But when I add the banner into the script for the mobile theme, it appears for a little while, then cache plugin seems to take it away. It and it disappers until the cache is cleared. Is there an easier way to add mobile advertising to the GeneratePress theme?

On the archive.php page I have add the following code:

<?php if(function_exists('the_ad')) the_ad(92033); ?>
</main><!-- #main -->

<!-- #primary -->

On the Header.php page I have added the folling:

do_action( 'generate_after_header' );
?>
<?php if(function_exists('the_ad')) the_ad(92033); ?>

Hi there,

try this CSS:

@media(max-width: 768px) {
    #masthead {
        display: block;
        opacity: 1;
    }
    #masthead .site-logo,
    #site-navigation {
        display: none;
        
    }
    #masthead .inside-header {
        padding-top: 0;
    }

    .header-widget {
        margin-bottom: 0 !important;
    }
}
This archived topic is closed to new replies.