Change Link in WordPress, Compatible Same Browser

Sunday, 20 Jun 2021 18:28:14 WIBby
English

CILACAP.INFO – This article not change mobile subdomain or subdirectory, but only change url or link if you open browser from mobile device or desktop.

Example, if you open and visit site but exist link on website from facebok or youtube from desktop, url with www and if you open from mobile phone, then it will change to url mobile.

If you have social media and you add link on website to follow social media, link to youtube channel or facebook channel, later will change and adjust to browser device.

This functions not use CSS or JavaScript, but only use and add, create with if and else.

This code very simple, okay i will gift tutorial to you.

<?php

if (wp_is_mobile())

{ echo //your code mobile

} else

{ echo //your code dekstop

} ?>

Comment