Hello meremetia,
If you want to exclude the inline article ads from specific categories or posts, you have to use a bit of CSS code to hide it. First of all, you have to get the category ID or post ID for your desired category or post, using your inspector and then you have to use the code below -> http://screencast.com/t/iqos0u0vY -> http://screencast.com/t/tpr1vFp2
Hope this helps!
Thank you for the message!
Hello,
I insert this code, but AD-2 don’t go out.
/* Removi anuncios post patrocinado Lebes */
.postid-77145 .td-a-rec-id-content_inline {display:none;}
.postid-77145 .td-a-rec-id-content_top {display:none;}
.postid-77145 .td-a-rec-id-content_bottom {display:none;}
.postid-77145 .td-a-rec-id-content_custom_ad_2 {display:none;}
/* Fim */
.postid-77036 .td-a-rec-id-content_custom_ad_2 {display:none;}
Print https://flic.kr/p/HqNTQq
My website http://www.eusouandroid.com
I add this post to you see this don’t work http://eusouandroid.com/download-uc-browser-navegador/
Hello pedroarmindo1,
I have checked your website and it seems to work your custom ad 2, as you can see here -> http://screencast.com/t/qHINcnIm Please provide a screenshot with your custom ad 2 field so I can see what type of code you are adding there.
Thanks.
Hello,
That is the problem. It works fine. But I want to hide in the post: http://eusouandroid.com/download-uc-browser-navegador/
I inserted the code in the Custom CSS did not work: .postid-77036 .td-the-rec-id-content_custom_ad_2 {display: none;}
Hello,
Please try the code below and place it in Theme panel->CUsotm CSS area.
The code is ->
.postid-77036 .td-a-rec-id-custom_ad_2 {
display:none!important;
}
The result -> http://screencast.com/t/BjqySvxicwW
Thanks.
Hello,
All the code that I’ve tried before include specifing the postid in css, but that’s not practical because I need to edit the css every time I add new post to category. Could you please provide some details and/or code that I can use to exclude the article-inline, article-top and article-bottom ads from all the posts that are within the specific category. I’m asking this because it’s not very clear to me how to do that from discussion above.
Thank in advance
-
This reply was modified 10 years by
mabaz.
Hello mabaz,
Unfortunately, our theme does not have such an option that offers you a way to exclude these ads for all the posts from a specific category, sorry! If you want to achieve this, you will need to do some additional customizations through code, add some if/else statements. Also, you will have to use the is_category() For more references in this regard, please consult the Codex documentation here -> https://developer.wordpress.org/reference/functions/is_category/ All of these customizations might to be added in td_module_single_base.php, the place where these ads are generated, like this -> http://screencast.com/t/EzUK0Dx8
If you want to develop our theme and if you are not aware of the steps which are needed to take in this regard, please consider hiring a freelancer/developer to help you because we cannot provide customization services at the moment, sorry!
Thanks for your understanding!
Hello Catalin,
thanks for your effort. I’ve tried to sort it out using css in custom code and it seems to be working as I wanted.
CSS code that I’ve uesd is:
article:not(.category1):not(.category2) .td-a-rec-id-content_inlineleft {display:none;}
where .category1 and .category2 are selectors of articles with specific class attributes.
-
This reply was modified 10 years by
mabaz.
Hello,
The only problem with this is that even with the Custom CSS, the ads still carry with the page, and at certain times it is possible to see the page of relocating to hide the ads.
There is a way to block the loading?
Thanks, work for me:
/* Remover anuncios de uma categoria específica Sorteio */
article:not(.sorteio) .td-a-rec-id-content_inline {display:none!important;}
article:not(.sorteio) .td-a-rec-id-content_inlineleft {display:none!important;}
article:not(.sorteio) .td-a-rec-id-content_top {display:none!important;}
article:not(.sorteio) .td-a-rec-id-content_bottom {display:none!important;}
article:not(.sorteio) .td-a-rec-id-custom_ad_1 {display:none!important;}
article:not(.sorteio) .td-a-rec-id-custom_ad_2 {display:none!important;}
article:not(.sorteio) .td-a-rec-id-custom_ad_3 {display:none!important;}
article:not(.sorteio) .td-a-rec-id-custom_ad_4 {display:none!important;}
article:not(.sorteio) .td-a-rec-id-custom_ad_5 {display:none!important;}
/* Fim */
Hello,
I’m not aware of any straightforward solution to what you’ve asked but there are some recommendations that you can consider. On my website I have added following code to .htaccess file:
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType text/html "access plus 2592000 seconds"
So it’s kind of workarround but it optimize loading because those lines utilize browser caching so user’s browsers will not fetch images (I’m guessing your ads are some kind of images) that often (as it would if there’s no mentioned code in .htaccess).
As you can see I’ve done same ‘optimization’, in terms of loading those resources, for the css and js.
Thanks.
Please, look my CustomCod, see it’s ok.
/* Remover anuncios de uma categoria específica Sorteio e Parceiros */
article:not(.sorteio):not(.parceiros) .td-a-rec-id-content_inline {display:none!important;} .sorteio.parceiros
article:not(.sorteio):not(.parceiros) .td-a-rec-id-content_inlineleft {display:none!important;} .sorteio.parceiros
article:not(.sorteio):not(.parceiros) .td-a-rec-id-content_top {display:none!important;} .sorteio.parceiros
article:not(.sorteio):not(.parceiros) .td-a-rec-id-content_bottom {display:none!important;} .sorteio.parceiros
article:not(.sorteio):not(.parceiros) .td-a-rec-id-custom_ad_1 {display:none!important;} .sorteio.parceiros
article:not(.sorteio):not(.parceiros) .td-a-rec-id-custom_ad_2 {display:none!important;} .sorteio.parceiros
article:not(.sorteio):not(.parceiros) .td-a-rec-id-custom_ad_3 {display:none!important;} .sorteio.parceiros
article:not(.sorteio):not(.parceiros) .td-a-rec-id-custom_ad_4 {display:none!important;} .sorteio.parceiros
article:not(.sorteio):not(.parceiros) .td-a-rec-id-custom_ad_5 {display:none!important;} .sorteio.parceiros
/* Fim */
Hello,
It used to work fine using a code like :
article.category-XXXX div.td-g-rec-id-content_inline {display: none}
but after the last theme it doesn’t seem to be working anymore.
What’s more, I don’t see any classes like this in the body tag when I view source.
I am wondering if the structure has changed at a last update and how to make it so inline ads will not appear if article is in category “XXX”. Could you help?
Thanks again!
Hello meremetia,
I have tested on my side and the code works as properly. Please be more careful about what type of add you are using. So, if you will use the Google Adsense code you will have to use the .td-g-rec-id-content_inline class and if you are using other ads, you will have to use the .td-a-rec-id-content_inline class.
Hope this helps!
Thanks.
Hi Catalin,
I think my problem is that apparently there is no article.category-XXXX added to the <body> any more.
Please see the screenshot here to understand what I mean: http://imgur.com/rnoBFqP
Any ideas how to fix?
Hello meremetia,
I suppose that you want to hide the article inline add for single posts, right? If you want this, please notice that you simply add the post ID number in front of the CSS code that hides the ad. For example, you can try this method -> http://screencast.com/t/0hdDLOp0
If you refer to something else, provide a screen pointing to the desired result, it would help us to understand what you’re trying to do.
Thanks.
hi,
I want to automatically hide the inline adds for posts that are of certain category, let’s say “trains”.
In the past, I was able to do it with
article.category-trains div.td-g-rec-id-content_inline {display: none}
article.category-trains div.td-a-rec-id-content_inline {display: none}
and that’s because there was a class article.category-trains added to the body of all articles that are in the trains category.
however, as you can see from my previous screen (and also your screen) the class article.category-CATNAME is no longer added to the body tag of articles
hope the above clarifies
Hello meremetia,
Please look at this screenshot -> http://screencast.com/t/WUIb8W5uc and from here you can use the category.
Thanks.
Hi tagDiv team,
I also would like to stop from loading the article inline ad in all our video articles (see this)
I currently have the following code in our custom CSS theme section.
Right after it, I’m adding the following code from above:
article.category-179 div.td-g-rec-id-content_inline {display: none}
where the number 179 is our video category ID.
Unfortunately the ad still loads.
Any other ideas how to fix this?
Thanks
-
This reply was modified 9 years by
DaveS.
