WordPress.org

Ready to get started?Download WordPress

Forums

Equivalent Mobile Redirect
[resolved] No. of URLs (14 posts)

  1. kerp777
    Member
    Posted 11 months ago #

    Hi,

    Your plugin is just what I'm needed.

    However, how do you add more URLs? Surely 10 is not the max...

    http://wordpress.org/extend/plugins/equivalent-mobile-redirect/

  2. uniquelylost
    Member
    Plugin Author

    Posted 11 months ago #

    Hi @kerp777
    10 URLs is what's currently coded but it is possible to add more... about how many are you looking to have?

  3. kerp777
    Member
    Posted 11 months ago #

    Well, an unlimited amount, honestly. We will be having a blog on our main site as well as our mobile subdomain, so yeah...

    As it stands, though, 20-40 would be ideal for now.

    But I just ran into another problem! The theme I use for our site uses a widgetized homepage, so I can't find the title to input into the plugin to redirect mobile visitors from the home page.

    Other regular pages are working just fine.

    Any ideas on how to solve this?

  4. uniquelylost
    Member
    Plugin Author

    Posted 11 months ago #

    I can email you a copy with more available redirects or tell you where to add them in the code?

    And yeah the pages currently do need a title in order to redirect them, in the next few days I'll add a option in the settings page for the homepage in case it doesn't have a title.

    If you are going to have a full blog on your main site and mobile site I would consider just making the main site responsive, this plugin was more made to redirect pages although it will redirect single posts too.

  5. kerp777
    Member
    Posted 11 months ago #

    I cannot start using the plugin until I get my home page to redirect, so if you want to finish working on that then you can email me a copy with more redirects.

    Thank you so much for help in advance! Great support!

  6. uniquelylost
    Member
    Plugin Author

    Posted 11 months ago #

    @kerp77 here is an alternative version of the plugin for a homepage without a name and with 30 possible redirects... Make sure you fill in the Homepage URL box because it is required...
    EM-Redirect

  7. uniquelylost
    Member
    Plugin Author

    Posted 11 months ago #

    cleaned up a bit and added a checkbox to enable/disable the Homepage redirect
    EM-Redirect

  8. uniquelylost
    Member
    Plugin Author

    Posted 11 months ago #

    Marking as resolved

  9. kerp777
    Member
    Posted 11 months ago #

    Thanks a lot, uniquelylost!

    One last question --

    What do I need to edit to add more fields if I need them?

  10. uniquelylost
    Member
    Plugin Author

    Posted 11 months ago #

    Inside the plugin folder you will see equivalent-mobile-redirect.php go on line 63 you will begin to see-

    $page_array[] = trim(wpw_get_option('wpw_emr_t1'));
    $page_array[] = trim(wpw_get_option('wpw_emr_t2'));
    $page_array[] = trim(wpw_get_option('wpw_emr_t3'));
    $page_array[] = trim(wpw_get_option('wpw_emr_t4'));
    $page_array[] = trim(wpw_get_option('wpw_emr_t5'));
    $page_array[] = trim(wpw_get_option('wpw_emr_t6'));

    etc....
    Just add more and change 'wpw_emr_t6' to the right number till you get to the amount you want...

    Then in admin/theme-options.php starting on line 69 you will begin to see pairs of title and url-

    $options[] = array("name" => __("Page Title #1 - e.g. About ",'wpw'),
    "desc" => __("",'wpw'),
    "id" => "wpw_emr_t1",
    "desc" => "",
    "type" => "text");
    
    $options[] = array("name" => __("Mobile Site URL #1 - http://m.sample.com/about ",'wpw'),
    "desc" => __("",'wpw'),
    "id" => "wpw_emr_murl1",
    "desc" => "",
    "type" => "text");

    Just add extra pairs after the last pair and change the "id"'s to the right number. They will be numbered like "wpw_emr_t1" & "wpw_emr_murl1" so you will be able to tell when the last pair is. If you need help once you need more though just let me know and I can help.

  11. lancecarr
    Member
    Posted 10 months ago #

    Hi uniquelylost and thanks so much for this plugin!

    It does exactly what Google actually wants, which is to redirect to the equivalent page, not just the Homepage of the mobile site.

    I have downloaded the version you put up with the ability to enter 30 URLs and followed your instructions to add more.

    I need to go up over the 100 mark and I am having a problem.

    Foe some reason when I add more than the 30 URLs the data is accepted but when I refresh everything above 30 simply disappears.

    Any idea why this keeps happening.

  12. lancecarr
    Member
    Posted 10 months ago #

    OK, I just found what I did wrong... move along folks nothin' to see here.

  13. uniquelylost
    Member
    Plugin Author

    Posted 10 months ago #

    Glad you got it to work :). And the idea of this plugin came from Google's new redirection guidelines. Google also recommends to add the following code to your mobile and desktop sites to identify them. This code to your desktop website header.php

    <link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.example.com/" />

    And than this to your mobile header.php

    `<link rel="canonical" href="http://www.example.com/" />'

  14. uniquelylost
    Member
    Plugin Author

    Posted 10 months ago #

    And than this to your mobile header.php
    <link rel="canonical" href="http://www.example.com/" />

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.