• mojican

    (@mojican)


    I have an adsense code in my header but I want to hide it on desktop view and make it only viewable in mobile. Is that possible?

    themusicstash.com

Viewing 4 replies - 1 through 4 (of 4 total)
  • You could make use of the core function wp_is_mobile()

    Codex page here

    Thread Starter mojican

    (@mojican)

    Thanks for the reply. I’m very new with this stuff.
    Would i paste this code <?php wp_is_mobile(); ?> and then my google adsense code?

    No, it’s a bit more involved than that. If you look at the codex page, it shows you how to wrap your code in an if statement. You need a certain familiarity with PHP to do that.

    Thread Starter mojican

    (@mojican)

    Ok thanks. I’ll take a look

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How can I hide a header code on desktop?’ is closed to new replies.