-
AuthorPosts
-
March 14, 2013 at 6:01 am #185830
Hello,
I have create new template for mobile in the link below and I want when the user enter the site using mobile redirect him to the new template. How can I do that ?!
http://www.s3rwa.net/wordpress
Regards,
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
March 15, 2013 at 8:15 am #486584Many ways to work with it but you can use php code
Open index.php on ROOT path
find
require_once JPATH_BASE.'/includes/framework.php';
change to
require_once JPATH_BASE.'/includes/framework.php';
require_once ( JPATH_BASE .DS.'libraries'.DS.'joomla'.DS.'factory.php' );
jimport( 'joomla.environment.browser' );$browser = &JBrowser::getInstance();
if($browser->isMobile())
{
/*Your code place here*/
header('Location: http://www.s3rwa.net/wordpress/');
}
March 16, 2013 at 8:16 am #486685Thanks Ninja Lead but it does not work for me…?!
March 17, 2013 at 12:14 pm #486730any help. please ?!
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
March 18, 2013 at 6:23 am #486801<em>@q8xbox 364811 wrote:</em><blockquote>any help. please ?!</blockquote>
Please pm me url, admin access and ftp access, I shall check it for you
March 20, 2013 at 12:16 pm #487217Does it work or not…?!
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
March 21, 2013 at 8:15 am #487305<em>@q8xbox 365405 wrote:</em><blockquote>Does it work or not…?!</blockquote>
I helped you add external code check device browser on your site.
require_once 'Mobile_Detect.php';
$detect = new Mobile_Detect;
$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
if($deviceType!='computer')
{
/*Your code place here*/
header('Location: http://www.s3rwa.net/mobile');
}
It’s working now, please check it and let me know the result
1 user says Thank You to Ninja Lead for this useful post
March 21, 2013 at 1:05 pm #487361Thanks Ninja Lead, every thing work fine now 😀
April 2, 2013 at 5:17 pm #488625Hello,
Can i add button on mobile template to switch to Desktop Template or not ?!
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
April 3, 2013 at 9:21 am #488689<em>@q8xbox 367258 wrote:</em><blockquote>Hello,
Can i add button on mobile template to switch to Desktop Template or not ?!</blockquote>
You can do that and i appreciate the hard work on your site, try this :
+ Go link http://www.s3rwa.net/mobile and add button Switch to Desktop Template with link format
<blockquote>http://www.s3rwa.net?ui=desktop</blockquote>+ Open code http://www.s3rwa.net/index.php running Desktop Template
Add condition ui = desktop do not redirect to mobile siteYou can hire a developer for getting this customization done.
-
AuthorPosts
This topic contains 11 replies, has 2 voices, and was last updated by q8xbox 11 years, 9 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum