Disable inline ads for categories

Posted in: Newspaper
Post count: 220

Hi,

we have some categories which we dont want to display inline google ads on the post from that categorry ..

-Srikanth

Post count: 7909

Hi,

You can try to add a condition in td_module_blog.php at inline ad something like this: http://screencast.com/t/SiFW5aiB
If you don’t have basic php experience I suggest to hire a freelancer to make this for you as for the moment we cannot provide custom work, sorry!

Thanks!

Post count: 220

can we use multiple category names using this methond…

Post count: 220

and also one more point can u copy Updated code in paste bin… to disabled ads from multiple categories

ad support on content
*/

//add the top ad

Post count: 6600

Hi,

You can add multiple categories to that condition using the 'and' and the category name. You would need custom work this unfortunately so I suggest you get a freelancer to do it fr you if you don’t know how to do it.

Thanks

Post count: 220

I tried this option unfortunately i saw some errors ..so i asked your help on that ….

Any how let me give it a try once again

Post count: 220

This helped …with the following code

$categories = get_the_category($this->post->ID);
foreach($categories as $category) {

if ($category->name != ‘category name’ and $category->name != ‘category name’ and td_util::is_ad_spot_enabled(‘content_inline’) and is_single() ) {

Post count: 220

Can you help me on this for the latest version …

Post count: 7909

Hi,

You can add your condition here – http://screencast.com/t/ppc7uLHJoah

Thanks!

Post count: 220

Can u post the complete code here … i used with below code its not working

//add the inline ad
$categories = get_the_category($this->post->ID);
foreach($categories as $category) {

if ($category->name != ‘category name’ and $category->name != ‘category name’ and td_util::is_ad_spot_enabled(‘content_inline’) and is_single() ) {

if (empty($tds_inline_ad_paragraph)) {
$tds_inline_ad_paragraph = 0;
}

$cnt = 0;

Post count: 7909
Post count: 220

Thanks, It works

Viewing 12 posts - 1 through 12 (of 12 total)
The forum ‘Newspaper’ is closed to new topics and replies.