if rules on ads

Posted in: Newspaper
Post count: 48

Hi there,

Firstly, thank you for the theme.

I would like to apply WordPress if rules on the ads that are called from the Theme Panel. For example I don’t want to header ad to appear on certain categories. I’m familiar with the php for wrapping the ads in an if rule, however as they aren’t hard-coded into the template php files, I can’t work out how to do this.

How is this achieved please?

Thanks,

Max

Post count: 48

Ignore this, resolved.

For anyone else, example: edit /parts/header/ads.php

This would make the header ad not appear on posts with the category slug ‘news’.

<?php
if (!in_category(‘news’))
{
?>

<div class=”td-header-rec-wrap”>
<?php
$tds_header_ad_title = td_util::get_option(‘tds_header_title’);

// show the header ad spot
echo td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘header’, ‘spot_title’ => $tds_header_ad_title)); ?>

</div>

<?php
}
?>

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.