WordPress.org

Ready to get started?Download WordPress

Forums

MobileESP for WordPress
Feature Request: Home Page Only (2 posts)

  1. pdxmission
    Member
    Posted 2 years ago #

    I'd like the have the ability to apply this redirect to the home page only on my website.

    With the current version of the plugin, if a mobile user visits my site, they are automatically redirected to the mobile version. At the top of the mobile site, there's an option to return to the full website -- thanks for having that feature.

    So far, so good.

    Lower down on my mobile site, I have a script that shows recent blog posts. Currently, when a mobile user clicks a blog post link, it doesn't take them back to the full website to view the blog post. Instead, they are forced back to the mobile site home page due to the mobile redirect.

    So if I can limit the plugin's redirect to occur only on my website home page, that will allow mobile visitors to visit internal blog pages (full version) in a new window, while still keeping the mobile version of my website active in another window.

    Make sense?

    http://wordpress.org/extend/plugins/mobileesp-for-wordpress/

  2. Brooke Dukes
    Member
    Plugin Author

    Posted 2 years ago #

    This should just be a simple modification of the mobileesp_wp.php file

    Try changing:

    if (($detect_mobile == 1)) {
    		  wp_redirect(get_option('mobileesp_wp_target_url'));
    			exit();}

    to:

    if (($detect_mobile == 1) && (is_home_page())) {
    		  wp_redirect(get_option('mobileesp_wp_target_url'));
    			exit();}

    Not tested but should work.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic