How to disable header ads on mobile for homepage.

Posted in: Newspaper
Post count: 436

I don’t want header ads to appear on the homepage when using mobile theme plugin on mobile.

How can I disable it for mobile?

Post count: 22421

Hi,

The mobile theme as you know has a different header ad than the desktop theme: http://screencast.com/t/5CyGWerl
If you only want to remove it on the mobile homepage you will have to add a condition around this code:
http://screencast.com/t/ZIMmqfCqcdx8
You will have to use is_page and use the page id number (you can see it in the browser inspector when inspecting the mobile homepage) as the is_home function will not work on the mobile theme.

Thank you!

Post count: 436

Hey, Yes, I want to remove it only for mobile theme and I am very well aware that it has totally different place to add codes and have different header.

So, I see http://screencast.com/t/ZIMmqfCqcdx8 but I don’t know what to do here. What do I need to do remove adds from homepage only. I can get the Page ID for homepage using Browser inspector but what to do next?

What’s the code and where do I need to add this code ( probably here: http://screencast.com/t/ZIMmqfCqcdx8)

Kindly be little more instructive 🙂 ( Sorry for being so dumb in coding )

Thank you.

Post count: 22421

Hi,
Sorry, please compare your code with the one I added there. You will see there is a if condition there wrapped around the standard theme code. Here is a more explicit screenshot:
before: http://screencast.com/t/nR8pDZeSFr
after: http://screencast.com/t/tdMKsBKlLE
Replace that last part of code with this one:

    <?php
        if ( !is_page(12577) ) {
            echo td_global_blocks::get_instance('td_block_ad_box_mob')->render(array('spot_id' => 'header_mob'));
        }
        ?>

and change the page id in the code to your own.

Thanks.

Post count: 436

Now I get this. I will try this soon and will let you know if it works.

Thank you. 🙂

Post count: 436

Finally I checked it today and it worked like charm.

Thank you so much 🙂

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