I´m currently working on a wordpress project and got in to some trouble.
I want to open a new tab with a page when users click on a link but only on computers. I found the following code for mobile detection:
<?php wp_is_mobile(); ?>
The reason I dont want the new link to open in a new tab on mobile is the fact that it opens “in front” of the other (my) page. This link contains a tracking cookie and thats why I need to get the visitor to open it.
How do I implement this code and prevent the mobile agent from opening new tabs?
Regards
Joel
If you were to use the
wp_is_mobile()
-function, that could look something like:Not sure if it’s correct syntax but idea should be clear.