WordPress Help Needed - Separate Link redirection for mobile and desktop devices
2015-08-09, 09:39 PM,
#1
Hey guys,

I have a PPD/CPA Wordpress website and have both good traffic for mobile and desktop devices.

I have only one product on the site which is kinda a generator and i think i will be using PPI method and also CPAgrip.

So, I want the download button to redirect all the mobile devices to my CPA link from CPAgrip which will help convert mobile traffic. And, I want the desktop devices to go to PPI link for the same download button. I am not a pro at coding so can anybody please give me detail instruction. Thanks a lot!

Have a Great Day!
Reply
2015-08-10, 03:59 PM, (This post was last modified: 2015-08-10, 03:59 PM by Pratik_.)
#2
You can do this using this PHP for WordPress post plugin - https://wordpress.org/plugins/php-code-for-posts/

Basically, you can create unlimited php MyCodes using that plugin and add that shortcode in the post. An example would be to first create a shortcode having contents like:

PHP Code:
<?php
//if the traffic is coming from mobile devices (includes iPads and tablets too)

if ( wp_is_mobile () )
{
?>
// put your mobile download button HTML code here
<?}
else { 
// for any other traffic other than mobile devices, for example desktops
?>
// put your desktop download button HTML code here
<?}?>

On saving this shortcode, you will get get a shortcode looking like [php snippet-1]. Paste that in your post where you want your button to output.

That's it. Hope this helps.

Edit;

You can also create multiple shortcodes like these for each post you want, so there are no limitations here. :-)
Latest Thanks - View all

screenfreezer(2015-08-10 06:16 PM) 
Reply
2015-08-10, 06:15 PM,
#3
Thanks a lot brother... :) I really needed it!
Reply
2015-08-10, 07:53 PM,
#4
(2015-08-10, 03:59 PM)Pratik_ Wrote: You can do this using this PHP for WordPress post plugin - https://wordpress.org/plugins/php-code-for-posts/

Basically, you can create unlimited php MyCodes using that plugin and add that shortcode in the post. An example would be to first create a shortcode having contents like:

PHP Code:
<?php
//if the traffic is coming from mobile devices (includes iPads and tablets too)

if ( wp_is_mobile () )
{
?>
// put your mobile download button HTML code here
<?}
else { 
// for any other traffic other than mobile devices, for example desktops
?>
// put your desktop download button HTML code here
<?}?>

On saving this shortcode, you will get get a shortcode looking like [php snippet-1]. Paste that in your post where you want your button to output.

That's it. Hope this helps.

Edit;

You can also create multiple shortcodes like these for each post you want, so there are no limitations here. :-)

is there any way for split the mobile traffic in two categories by the OS: android and iOS ?

Pay the cost to be the boss

Reply
2015-08-10, 08:06 PM,
#5
(2015-08-10, 07:53 PM)BaStan Wrote: is there any way for split the mobile traffic in two categories by the OS: android and iOS ?
I don't know if there's an inbuilt WordPress function for it like it has to detect mobile devices, but using PHP to detect user-agent (you can Google that) should work well I believe. Since you can use any type of PHP and advance code, everything can be done. :)
Reply
2015-08-10, 08:07 PM,
#6
(2015-08-10, 08:06 PM)Pratik_ Wrote:
(2015-08-10, 07:53 PM)BaStan Wrote: is there any way for split the mobile traffic in two categories by the OS: android and iOS ?
I don't know if there's an inbuilt WordPress function for it like it has to detect mobile devices, but using PHP to detect user-agent (you can Google that) should work well I believe. Since you can use any type of PHP and advance code, everything can be done. :)

I would search for it ,thanks for the idea with user-agent function, I forget about that Grin

Pay the cost to be the boss

Reply
2015-08-10, 08:08 PM, (This post was last modified: 2015-08-10, 08:08 PM by Pratik_.)
#7
(2015-08-10, 06:15 PM)screenfreezer Wrote: Thanks a lot brother... :) I really needed it!
Not an issue. Happy to help!

(2015-08-10, 08:07 PM)BaStan Wrote:
(2015-08-10, 08:06 PM)Pratik_ Wrote:
(2015-08-10, 07:53 PM)BaStan Wrote: is there any way for split the mobile traffic in two categories by the OS: android and iOS ?
I don't know if there's an inbuilt WordPress function for it like it has to detect mobile devices, but using PHP to detect user-agent (you can Google that) should work well I believe. Since you can use any type of PHP and advance code, everything can be done. :)

I would search for it ,thanks for the idea with user-agent function, I forget about that Grin
Great. The pleasure's all mine. :-)
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [FREE] Social locker with timer [Facebook Share,Google+ and Tweet] [FB app ID needed] K.K 41 10,354 2017-12-09, 11:06 PM
Last Post: glowerz7
  ★★★ TOO EASY 5$+ PER DAY - NO HOSTING NEEDED Mesina 86 9,002 2017-12-08, 06:41 PM
Last Post: mastyle
  Wordpress Gaming Theme - Blackfyre [Latest Version] Qartis 5 1,943 2017-12-08, 09:59 AM
Last Post: kaly60
  Mr. X’s SEO Whitehat Link Building Membership [Share][HQ] TheDutchLegend 10 492 2017-12-08, 09:42 AM
Last Post: atebon
  Madden NFL Mobile Hack Generator Landing Page MrLions 7 730 2017-12-06, 01:06 PM
Last Post: WillydaDon





About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top