Jump to content

Capture current url and update dynamically?


DSchragg

Recommended Posts

I currently have Wordpress 3.1 running in network mode so that I could have 1 site but in 2 languages.

 

the url's are as follows:

 

http://mysite.com/ - English

http://mysite.com/fr - French

 

I want to have a link embedded in the template that will say either French or English and when clicked take the user to the same page they are viewing but in the other language. All my pages and articles on both sites will have the same permalinks, so what I want to have is a link that will grab the current url or page being viewed and add the fr into the link automatically, so that I never have to manually update these links.

 

Example:

When viewing Page 1 English, the href would automatically provide a link to Page 1 in French, and update itself dynamically as you viewed different pages..

 

mysite.com/page1 turns into mysite.com/fr/page1

 

Is this possible?

 

Thanks for everyones help.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.