Etiquetas de las plantillas principales
Los anuncios de AdSanity se pueden colocar de forma programática. Hay dos etiquetas de plantilla disponibles para los usuarios. Una para añadir un solo anuncio y otra para mostrar un grupo de anuncios. Es posible que desee añadir estas etiquetas a plantillas o partes de plantillas específicas para mostrar sus anuncios.
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 plantillas adicionales
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.