Front Page on mobile theme – different than static frontpage for desktop

  • Anonymous

    #5833

    I have my blog set for a static front page and make use of the Homepanes – http://runblog.adamcondit.com …. the mobile site corresponds to this: http://runblog.adamcondit.com/?mobile_switch=mobile ….. doesn’t have my “posts” – just lists of categories I can choose to list.

    Since there isn’t really the equivalent to “panes” for the mobile site, it’d be nice to just have my posts listed as they are on the POSTS PAGE mobile site – http://runblog.adamcondit.com/posts/?mobile_switch=mobile

    Basically want to use the FRONT PAGE for desktop and POST PAGE for mobile – any way to do this? I want to stay with the graphene family – love the home panes AND the mobile theme – I just want to be able to use the full power of both.

    Mod

    Kenneth John Odle

    #32760

    You might want to try disabling your plugins first, to make sure that this is not a plugin-related issue.

    http://blog.kjodle.net/2012/06/15/disable-your-wordpress-plugins/

    Anonymous

    #32761

    This is not a plugin related issue. He wants to show recent posts on mobile site homepage despite having a static front page.

    @Adam I’d write a custom function to list recent posts with except and hook it into any of action hooks available in index.php

    Anonymous

    #32762

    Or, redirect static front page to blog page only on mobile version, perhaps?

    Anonymous

    #32763

    I was thinking of doing the redirection … how can I do this for only mobile users? The urls I mentioned before were generated by manually switching … I would need to forward the root runblog.adamcondit.com to runblog.adamcondit.com/posts ONLY FOR MOBILE USERS….

    Fyi – I’m using Mobile Smart plugin to do my switching

    Anonymous

    #32764

    Okay, I got a solution for redirecting homepage to posts page only for mobile devices. All you have to do is to add the below code to Graphene [url=https://forum.graphene-theme.com/how-to/child-theme-functionality-with-graphene-mobile/]Mobile Child Theme[/url]’s functions.php file.

    <?php
    function redirect_home_to_blog_mobile() {
    if ( is_front_page() ) {
    wp_redirect ( get_permalink( get_option( 'page_for_posts' ) ) );
    exit;
    }
    }
    add_action('template_redirect', 'redirect_home_to_blog_mobile');
    ?>

    You can see this on my test site. Open http://test.prasannasp.net in a mobile phone and you’ll be redirected to http://test.prasannasp.net/blog/ which is the posts page.

    Ping me if you want any help to implement this on your site.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Do NOT follow this link or you will be banned from the site!