• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Trying to redirect just my homepage for mobile

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Trying to redirect just my homepage for mobile

This topic is: not resolved

Tagged: front page, Magazine Pro, wp_is_mobile, wp_redirect

  • This topic has 4 replies, 2 voices, and was last updated 9 years, 2 months ago by molly.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • June 1, 2017 at 11:40 am #207259
    molly
    Member

    Hi,
    I'm using the Magazine Pro theme and wondering if there's a way to display a different homepage on mobile devices?

    I have tried to use redirect plugins but they don't work because the homepage is not really a page.

    Any ideas? Thanks

    http://101things.com/delnorte/
    June 2, 2017 at 4:57 am #207268
    Brad Dalton
    Participant

    You could try something like this in functions.php: Untested.

    add_action( 'genesis_meta', 'redirect_front_page_when_mobile' );
    
    function redirect_front_page_when_mobile() {
    
    if ( wp_is_mobile() && is_front_page() ) {
    
    wp_redirect( 'http://www.example.com', 301 ); exit;
        }
    }
    

    Swap out the URL with another

    Here's a few other ways to redirect a page in WordPress.

    You could also use template_redirect

    add_action( 'template_redirect', 'redirect_front_page_when_mobile' );
    
    function redirect_front_page_when_mobile() {
    
    if ( wp_is_mobile() && is_front_page() ) {
    
    wp_redirect( home_url( '/mobile-front-page/' ) ); 
    exit;
        }
    }
    

    Tutorials for StudioPress Themes.

    June 2, 2017 at 3:46 pm #207288
    molly
    Member

    Hi,

    Thanks for your response. I tried the first method and it redirected for a second and then I got this error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/things/public_html/delnorte/wp-content/themes/genesis/lib/structure/header.php:60) in /home/things/public_html/delnorte/wp-includes/pluggable.php on line 1195

    June 2, 2017 at 10:55 pm #207292
    Brad Dalton
    Participant

    In did state they are untested.

    Try the second method.


    Tutorials for StudioPress Themes.

    June 5, 2017 at 1:06 pm #207359
    molly
    Member

    I know you said it was untested...I was just wondering if you had an idea for a fix for the above error. Second method didn't work

    Thanks though.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble