Etiquetas do núcleo do modelo

Os anúncios AdSanity podem ser colocados programmaticamente. Há dois modelos de etiquetas disponíveis para os utilizadores. Uma para adicionar um único anúncio e outra para mostrar um grupo de anúncios. Pode querer adicionar estas etiquetas a modelos específicos ou partes de modelos para exibir os seus anúncios.

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, )); ?>

Etiquetas de modelos adicionais

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.