Template Tags

AdSanity ads can be placed programmatically. There are two template tags available for users. One to add a single ad and one to show an ad group. You may want to add these tags to specific templates or template parts to display your advertisements.

To show a single ad:

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

To show a group of ads:

<?php
adsanity_show_ad_group(
	array(
		'group_ids'	=> array(), // an array of valid group ids (you can get these from the main list of ad groups
		'num_ads'	=> 1, // number of ads to show total
		'num_columns'	=> 1 // number of ads to show per row
	)
);
?>