[Support request] Add two different ad scripts in Head – One for mobile and one for desktop?

Home Forums Support [Support request] Add two different ad scripts in Head – One for mobile and one for desktop?

Home Forums Support Add two different ad scripts in Head – One for mobile and one for desktop?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1072094
    Emil

    Hi!

    I need to add two different scripts for ads i the head of the website. The thing is that they both should not load at the same time.

    One is for desktop only and the other one is for mobile. It´s going to cause problems if both of them loads in the background at the same time.

    How can i do this?

    I have not set up the website yet so i can´t show you the specific site.

    #1072323
    David
    Staff
    Customer Support

    Hi there,

    its not completely bullet proof but you can use the wp_is_mobile() function to wrap your scripts

    https://developer.wordpress.org/reference/functions/wp_is_mobile/#user-contributed-notes

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