Custom Ad Sizes

The Custom Ad Sizes Add-On provides the AdSanity manager with a simple-to-use interface for creating custom ad sizes for use with AdSanity. As a bonus, the Add-On displays all of the standard supported sizes on a convenient page to ensure that you don’t create an ad size that already exists. In addition, it makes a fine reference for planning your ad units. You are able to create and delete new ad unit sizes as well as delete the standard ad unit sizes. This way you can prevent unwanted add units from being used on the site. This also focuses your ad creation on the ad units that you are using on the site.

In order for custom sizes to display correctly within your theme, you may need to add CSS to support for it. The following styles should be added to your Styles.css file.

.ad-WIDTHxHEIGHT {
height: auto;
max-height: HEIGHTpx;
max-width: WIDTHpx;
position: relative;
width: 100%;
height: HEIGHTpx;
}

.ad-WIDTHxHEIGHT .adsanity-inner {
height: 0;
overflow: hidden;
padding-bottom: RATIO%;
position: relative;
width: 100%;
}

.ad-WIDTHxHEIGHT .adsanity-inner iframe {
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
}

.ad-WIDTHxHEIGHT .adsanity-inner img {
height: auto;
width: 100%;
}

Change WIDTH and HEIGHT throughout this snippet to match your custom ad size. Additionally, change RATIO with the result of (WIDTH / HEIGHT) * 100. Do not round the result.

Requirements: All Add-Ons require the latest version of AdSanity Core.

The Add-On displays as a new entry in the AdSanity section of the dashboard.

All of the registered ad sizes are displayed on the page and can be deleted, modified, or added to.

← Back to Add-Ons

custom-ad-sizes