One of the things we get asked about a lot is how to avoid detection from Ad Blockers. While we’ve explained other options to respect those visitor’s ad display preferences, we understand that there are some instances that you aren’t using AdSanity for typical advertising. Maybe you’re just using AdSanity to track views and clicks on Image based content, for example. We provide you with a couple of methods to modify the display of individual ads, groups of ads, or all ads.

Stylisation des unités publicitaires

Each Ad Unit has a number of CSS Classes and a unique HTML ID that you can target in your theme’s CSS to change its look. The format of these are:

  1. ad-{size} (exemple : ad-125x125) – This allows you to style all ads of the same size
  2. column-{column number} (exemple : column-2) – While relevant only to groups of ads, this allows you to style all ads in a particular column
  3. alignleft | aligncenter | alignright | alignnone – These four styles are generally already handled inside of most themes, but if you want to apply additional styles to better handle alignment, this is the place to do so. Note: only one class will be added to each ad unit.

If all of those classes don’t suit your needs or you want to change them, you can attach additional classes to each Ad Unit using a filter as described below.

Quelques actions et filtres liés à l'affichage sont intégrés à notre système de création de modèles. Ils vous permettent de filtrer les classes CSS et d'ajouter des balises autour de l'unité publicitaire afin de pouvoir la styliser.

Filtres

Actions

Modèles de thèmes

Sometimes you need to have more control over the markup for your ads. We’ve extended WordPress Core’s template hierarchy to allow you to fully customize an ad’s markup through a theme template.

Si vous souhaitez modifier le balisage de toutes les annonces, il vous suffit de copier l'élément suivant ad.php à partir du fichier theme-templates dans votre thème et personnalisez-le.

If you want to modify the markup for all ads of a particular size, you can rename that file to something like ad-125×125.php, where 125×125 is the size that you’re trying to modify. Note: you can find the size by looking at the classes that are applied to the ad in the markup.

Enfin, si vous souhaitez modifier le balisage d'une annonce particulière, vous pouvez renommer le fichier en ad-1234.php où 1234 est l'ID de l'annonce que vous souhaitez modifier. Remarque : vous pouvez trouver l'ID en regardant l'ID HTML qui est appliqué à l'annonce dans le balisage.

Didn’t find what you were looking for?

If you’re a subscriber to AdSanity and don’t find an answer to your specific question please submit a request and our support department will address your issue quickly.