Etiquetas do modelo principal
Os anúncios AdSanity podem ser colocados programmaticamente. Há dois modelos de tags disponíveis para os usuários. Uma para adicionar um único anúncio e outra para mostrar um grupo de anúncios. Você pode querer adicionar estas tags a modelos específicos ou peças de modelos para exibir seus anúncios.
Para mostrar um único anúncio:
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,
)
);
Para mostrar um grupo de anúncios:
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
Para mostrar anúncios rotativos:
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,
)
);
Para mostrar anúncios encomendados:
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.
