Adsense?
-
I am using a plugin for adsense called quick adsense which puts my ads on all my pages and posts. I would like to use the themes adsense placement for the homepage and categories etc. is there a way to disable the ads for only pages and posts? I Searched the forums and found this to remove them from pages but don’t know how to add posts to this. Any help greatly appreciated.
<?php
function hide_adsense_if_page() {
global $graphene_settings;
if(is_page() ) {
$graphene_settings['show_adsense'] = false;
}
}
add_action( 'template_redirect', 'hide_adsense_if_page' );function hide_adsense_if_page() {
global $graphene_settings;
if( is_page() || is_single() ) {
$graphene_settings['show_adsense'] = false;
}
}
add_action( 'template_redirect', 'hide_adsense_if_page' );Admin
Only if you haven’t already have that opening PHP tag in your file and haven’t closed it if you have one.
http://www.php.net/manual/en/language.basic-syntax.phptags.php
Admin
Marking thread as resolved. You can do this yourself as well.
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.
