I'm helping with a custom multi language site. We have one page in English, then an equivalent page in French. I've got a "SWITCH LANGUAGE" link in the main container (next to the breadcrumbs) that takes you to the English home page if on any French page, and vice versa.

Aside from using a plugin, how can I make this link more dynamic by having it point to the equivalent page, whether French or Engligh? E.g. when a user is on the "Events" page, the l ink points to the "Evènements" page, but when on the "Fundraising" page, it points to "Levée de fonds" page.

Here's the code I'm using now to switch languages, using custom fields to give all Engligh pages a Name of "MenuName" and a Value of "English". This then serves either the breadcrumbs.php or my new breadcrumbs-en.php, which has the appropriate link to it. I don't think this is the best way to do this however, since it is dependent on the breadcrumbs.


if (get_post_meta($post->ID,'MenuName', true))

So I'm looking more for the theory of linking the two pages, by way (I think) of assigning custom field values for each page(?)

2 Answers 2


There is a plugin named Multilingual Press doing exactly what you described.

As a lightweight solution, you could create a network table to store the relations and a metabox for all posts where you can search and assign posts from other pages to update the network table.

Do not use post meta data. You would have to synchronize two different tables, that will break sooner or later. Never store the same information in two places.

  • This is working out well, now I just need to figure out how to show the link outside of a widgetized area (I know many plugins also offer a php snippet to insert the HTML wherever you want). Any ideas? :)
    – Drewdavid
    Commented Oct 30, 2012 at 18:47
  • In Multilingual Press look at the function mlp_show_linked_elements(). You can use that function wherever you need it.
    – fuxia
    Commented Oct 30, 2012 at 19:41
  • Thanks, I ended up making a new widgetized area and placing the widget there.
    – Drewdavid
    Commented Jan 24, 2013 at 2:55

You can use the Relationship field of Advanced Custom Fields Add the field to each page and select the "equivalent page" (either English or French) from a simple dropdown field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.