BuddyBoss Home – Web › Support Forums › Themes › Boss. theme › Desktop/Mobile Front Page
Tagged: front page, homepage
- This topic has 5 replies, 2 contibutors, and was last updated 9 years, 7 months ago by Anonymous.
Question
April 6, 2015 at 1:21 am #38551@
AnonymousIs it possible to display a different front page (homepage) on smart phones as compared to desktop and tablet?
Answers
April 6, 2015 at 11:46 am #38564@
AnonymousHi @ryanmaler, you can use create some conditional logic using wp_is_mobile
ref url
https://codex.wordpress.org/Function_Reference/wp_is_mobileexample
function mobile_home_redirect(){ if( wp_is_mobile() && is_front_page() ){ include( get_template_directory() . '/home-mobile.php' ); exit; } } add_action( 'template_redirect', 'mobile_home_redirect' );
with the above function you just need to create file with name home-mobile.php inside the child theme folder which contain the page template what you want to use for mobile devices.
Thanks
Varun DubeyApril 6, 2015 at 12:56 pm #38573@
Anonymous@vapvarun Sounds like exactly what I’m looking for. I’m going to play around with the template a bit. Thanks Varun.
April 11, 2015 at 5:10 pm #38814@
Anonymous@vapvarun I have one question. How do I specify which wordpress page I want to show as the mobile homepage?
April 11, 2015 at 8:15 pm #38817@
Anonymous@vapvarun never mind Varun. I decided to go a route using visual composer’s nift row hiding feature to hide desktop items and show mobile items. I may revisit this if the visual composer route does not pan out. Thanks
April 12, 2015 at 7:32 am #38826@
Anonymousno issue, those are just minor code edits to display any pages as front page
Regards
Varun Dubey
- The question ‘Desktop/Mobile Front Page’ is closed to new replies.