This is the documentation of PopUp and Layer Ads. It offers an overview of the features and functions of the plug-in. You will also find links to additional in-depth articles and tutorials here.


After you installed and activated the plugin, you find a new placement at Advanced Ads > Placements with the following icon.

layer placement icon

Choose this placement and create it like any other placements with the (internal) title and the ad you would like to display.

After the placement is created you find a few settings under advanced options in the placement options (see Placement options below)


General Settings

Go to Advanced Ads > Settings > General > PopUp and Layer Ads to choose whether to use the Fancybox plugin to display the ads or not. Fancyboxes are more beautiful and work better especially on mobile devices than the default script, but it might break if you are already using this script for another purpose on your site. Hence, it is not the default option.

Placement options

When should the ad show up

right away – the layer is displayed when the page is loaded

when a user stops scrolling – display the ad when the user scrolled and stopped anywhere on the page

after user scrolled to the second half of the page – when the user stopped scrolling on the second half of the page (half down the possible scrolling distance)

after user scrolled … px – Choose this option to set a custom scroll offset. The offset is meant as the distance from the top of the page. In case the page is already loaded with this position, the ad is displayed right away.

when user wants to leave the page – when the user scrolls to the top of the page – mostly to close the page or enter a new address.

Enable background

Enable this option to put an overlay on the content and only display the ad above this. The overlay will be removed if the ad is removed, so be sure to use the close button together with this option.


Different effects for the ad to appear. Effects might look different for the default js or the fancybox method.

You can also select a delay for the effect.

Add Close button

Enable this option to allow visitors to remove an ad with a close button. You can also choose where to display the button (only for non-fancybox).

Enable the timeout, so a closed ad is not displayed to the user again within the time frame (in days). Choose “0” to disable the ad only for the current session.


You can choose from 9 positions of the layer with the center of the screen being the default option.

Other notes

If you are using an ad network, please confirm with them before using layer ads with their ads. Some ad networks (e.g., AdSense) see any positioning of their ads in a popup as a violation of their terms of service and might ban you in case they become aware of it.

Try to not use multiple layer placements or at least use the display conditions of the ad to only deliver one placement to the frontend.

Some of the above options that only display an ad under specific conditions and still load the ad, but hide it at first. If you have an ad statistic, the impression might still show up. Confirm with your ad network or ad vendor before using those options. I am using those mostly to display banners and popups with my own, internal ads, affiliate links or static banners (images).

Additional Options

Adjusting the button layout

You may adjust the size of the close button by applying some custom CSS attributes to it. You can find a tutorial on how to do that here.

   transform: scale(1.5);

Please note that the styles added to this class will also be applied to the close button of the Sticky Ads plugin.

Trigger the PopUp with a click

Use the following information to open a PopUp with a click in addition to another trigger.

This simple code works best with the basic mode, not with the Fancybox and if you have only one PopUp configured. Put this code either in the head or footer section of your page, e.g., by putting it into a plain code ad and using the Head placement to inject it into the header.

Replace the string PREFIX with your site’s prefix set in Advanced Ads > Settings > General > ID prefix.

jQuery(document).ready(function(jQuery) { 
     jQuery('.showpopuplink').each(function() {
          jQuery(this).on('click', function(e) {
              advads_display_effect_show(  jQuery('.PREFIXlayer').attr( 'id' )  ); // replace PREFIX with your site’s prefix

Then create a link based on the code below.

<a href="#" class="showpopuplink">Show PopUp now</a>

Of course you need to make sure that the PopUp ad is not visible directly after loading the page. This could be reached e.g. by setting a long time interval until the ad will be visible (see menu item Show The Ad: you might use “after 1209600 seconds” for example – this would be 14 days).

Remove border and background for Fancybox option

If you are using the Fancybox option to display PopUps in combination with transparent ad images then you can apply the following code to your theme’s functions.php to remove the border and background from all PopUps.

add_action( 'wp_head', function() {
.fancybox-bg{ display: none; background: none !important; }
#fancybox-outer { background: transparent; }
#fancybox-content { border-color: transparent; }
} );

Custom close button

To add your own close button to the ad content just give the clickable element the class advads-close-button.