I want to show a template content if ad not available
i use this code but
both ad & template content are showing
<?php
if(dt_show_ads('position=Header&before=<div>&after=</div>'))
{
?>
<!-- Some content here -->
<?php
}
else
{
include TEMPLATEPATH.'/templates/newsleft_col.tpl.php';
}
?>
dt_show_ads('position=Header&before=<div>&after=</div>')seems to not return any value. This evaluates tofalsein PHP.What
dt_show_ads()does, though, is to insert ad html (if there is any).Therefor, no matter if there are ads or not, your
elsepart is always executed.A quick google query didn’t turn up any sensible documentation on dt_show_ads for me, you might wanna try this though:
Edit:
Since, per your comment,
dt_show_ads()doesn’t support the WP-semi-standardechoargument, you’ll need to buffer its output to be able to check it: