Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    the adcontrol system needs a lot of improvement.

    Do not hesitate to share your ideas here, or send us an email with your remarks:
    https://wordpress.com/help/contact

    I was wondering if there is any way to exclude WordAds from a specific page like the front page.

    Try to paste the following code in your theme’s functions.php file, or in a functionality plugin:

    remove_action( 'wp_head', array( 'AdControl', 'insert_header_ad' ), 100 );

    Let me know how it goes.

    Thread Starter Tanvir Hasan

    (@tanvirhasan93)

    Thanks for the help. But this isn’t working.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Thanks for giving it a try. We’re considering adding a new filter in the next AdControl update, to make this easier.

    I’ll let you know as soon as I have some news about this!

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Good news! As soon as the next version of AdControl is released, you’ll be able to hide the header ad like so:

    add_filter( 'radcontrol_header_ad_show', '__return_false' );

    To hide it on a specific page, you can wrap that file in conditional tags:
    https://codex.www.ads-software.com/Conditional_Tags#The_Front_Page

    Plugin Author Derek Springer

    (@derekspringer)

    I’m actually rejiggering the filters a little to be in line with some of our other code, but you should be able to use:

    1. adcontrol_header_disable set to true will prevent header unit from displaying
      .e.g. add_filter( 'adcontrol_header_disable', '__return_true' );
    2. adcontrol_inpost_disable set to true will prevent the in post unit from displaying
      .e.g. add_filter( 'adcontrol_inpost_disable', '__return_true' );
    Thread Starter Tanvir Hasan

    (@tanvirhasan93)

    Thanks again for the help. I will give it a try. When is the next update coming?

    Plugin Author Derek Springer

    (@derekspringer)

    Should be pretty soon, I’m working on the update right now ??

    Thread Starter Tanvir Hasan

    (@tanvirhasan93)

    Thanks for the quick update Derek. This works great. But I was wondering if there is way to exclude ad unit from appearing from a single specific page like the front page. Not all the post pages.

    Again thanks for the help and I am sure Wordads will improve a lot in the future and it will improve more quickly then before.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    You can use conditional tags to choose where the filter is applied.

    To remove the top ad from your home page only, you could use the is_front_page() conditional tag. To do so, paste the following in your theme’s functions.php file, or in a functionality plugin:

    function jeherve_remove_top_ad_hp() {
    	if ( is_front_page() ) {
    		add_filter( 'adcontrol_header_disable', '__return_true' );
    	}
    }
    add_action( 'wp_head', 'jeherve_remove_top_ad_hp', 10 );

    Oops, got it to work for the home page ??

    function jeherve_remove_top_ad_hp() {
    if ( is_front_page() ) {
    add_filter( ‘adcontrol_inpost_disable’, ‘__return_true’ );
    }
    }
    add_action( ‘wp_head’, ‘jeherve_remove_top_ad_hp’, 10 );

    Ads will not come there a problem with me? vsback.com

    Moderator Bet Hannon

    (@bethannon1)

    Pasifik115, per forum guidelines, please create your own new support topic. This will enable us to give you better support.

    Hi everybody,

    Hope you are enjoying your holidays.

    I’ve tried solutions suggested by Jeremy and Leokoo, both without success.
    I’m currently experiencing a bad time with a lot of ad boxes all around the front page, 11 in total!
    At the end of every article’s excerpt, there are ads showing up. Because of this, the site is slowing down. You can see here: transeuntemx.com

    Could you please help me to deactivate those ads on the front page. Ideally I would like to have them just on the side bar.

    Thanks for your support.

    Arturo

    Moderator Bet Hannon

    (@bethannon1)

    Arturo, please make your own fresh topic, per forum guidelines.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Exclude Wordads from front page’ is closed to new replies.