Tags du modèle de base

Les publicités AdSanity peuvent être placées de manière programmatique. Deux modèles de balises sont disponibles pour les utilisateurs. L'une permet d'ajouter une seule publicité et l'autre d'afficher un groupe de publicités. Vous pouvez ajouter ces balises à des modèles spécifiques ou à des parties de modèles pour afficher vos publicités.

To show a single ad: <?php adsanity_show_ad( array( // any valid ad ID will do // (you can get this from the main list of ads) ‘post_id’ => 1, // (one of the following: // alignleft, aligncenter, alignright or alignnone) ‘align’ => false, // this will optionally return the output instead of echoing it ‘return’ => false, )); ?>

To show a group of ads: <?php adsanity_show_ad_group( array( // an array of valid group ids // (you can get these from the main list of ad groups) ‘group_ids’ => array(), // number of ads to show total ‘num_ads’ => 1, // number of ads to show per row ‘num_columns’ => 1, // this will optionally return the output instead of echoing it ‘return’ => false, )); ?>

Balises de modèles additionnels

To show rotating ads: <?php adsanity_show_rotating_ads( array( // random ads or date-based ordering ‘random’ => true, // any valid group id ‘group_id’ => 0, // (one of the following: alignleft, aligncenter, alignright or alignnone) ‘align’ => false, // how many seconds to show an ad before rotating ‘time’ => 30, // setting a max width can help keep ads responsive, // but also no wider than necessary ‘max_width’ => 0, // this will optionally return the output instead of echoing it ‘return’ => false, )); ?>

To show ordered ads: <?php function adsanity_show_ordered_ads( array( // the number of columns to output ‘num_columns’ => 1, // an array of valid ad ids // (you can get these from the main list of ads) ‘ad_ids’ => array(), // (one of the following: // alignleft, aligncenter, alignright or alignnone) ‘align’ => ‘alignnone’, // this will optionally return the output instead of echoing it ‘return’ => false, ));

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.